code: public static Range<IPv4> cidrRange(String cidr) {
          try {
              CidrInfo cidrInfo = parseCIDR(cidr);
              if (cidrInfo.getNetwork() instanceof Inet4Address &&
                      cidrInfo.getBroadcast() instanceof Inet4Address) {
  
                  return closed(new IPv4((Inet4Address) cidrInfo.getNetwork()),
                          new IPv4((Inet4Address) cidrInfo.getBroadcast()));
              }
  
          } catch (Exception ignored) {}
  
          throw new IllegalArgumentException(format("Invalid IPv4 cidr representation %s", cidr));
      }
docs: Parses the provided CIDR string and produces a closed {@link Range} encapsulating all IPv4 addresses between
  the network and broadcast addresses in the subnet represented by the CIDR.