@Test public void testIsValidIPv4Cidr() throws Exception { assertThat(isValidIPv4Cidr("10.10.10.10/23"), is(true)); assertThat(isValidIPv4Cidr("0.0.0.0/24"), is(true)); assertThat(isValidIPv4Cidr("127.0.0.1/25"), is(true)); assertThat(isValidIPv4Cidr("10.10.10.10/-1"), is(false)); assertThat(isValidIPv4Cidr("500.10.10.10/32"), is(false)); assertThat(isValidIPv4Cidr("10.10.10.10/50"), is(false)); assertThat(isValidIPv4Cidr("10.10.10.10/blah"), is(false)); }
public static boolean isValidIPv4Cidr(String cidr) { return cidr.matches(IPv4_CIDR); }
HostAndIpValidator { public static boolean isValidIPv4Cidr(String cidr) { return cidr.matches(IPv4_CIDR); } }
HostAndIpValidator { public static boolean isValidIPv4Cidr(String cidr) { return cidr.matches(IPv4_CIDR); }  }
HostAndIpValidator { public static boolean isValidIPv4Cidr(String cidr) { return cidr.matches(IPv4_CIDR); }  static boolean isValidHost(String host); static boolean isValidIPv4(String ipAddress); static boolean isValidIPv4Cidr(String cidr); static boolean isValidIPv6(String ipAddress); static boolean isValidIPv6(String ipAddress, boolean brackets); static boolean isValidIPv6Cidr(String cidr); static String getIPv4Suffix(); static String getIPv6Suffix(); }
HostAndIpValidator { public static boolean isValidIPv4Cidr(String cidr) { return cidr.matches(IPv4_CIDR); }  static boolean isValidHost(String host); static boolean isValidIPv4(String ipAddress); static boolean isValidIPv4Cidr(String cidr); static boolean isValidIPv6(String ipAddress); static boolean isValidIPv6(String ipAddress, boolean brackets); static boolean isValidIPv6Cidr(String cidr); static String getIPv4Suffix(); static String getIPv6Suffix();  }