@Test public void ShouldAcceptIPv6Subnets() { int i; String ip; for (i = -65536; i <= 6536; i++) { ip = String.format("ffff::/%d", i); if (i >= 0 && i <= 128) { assertTrue(String.format("Expected acceptance of %s", ip), IPUtils.IP6RegEx(ip)); } else { assertFalse(String.format("Expected rejection of %s", ip), IPUtils.IP6RegEx(ip)); } } }
public static boolean IP6RegEx(String ip) { return ipv6Pattern.matcher(ip).matches(); }
IPUtils { public static boolean IP6RegEx(String ip) { return ipv6Pattern.matcher(ip).matches(); } }
IPUtils { public static boolean IP6RegEx(String ip) { return ipv6Pattern.matcher(ip).matches(); }  }
IPUtils { public static boolean IP6RegEx(String ip) { return ipv6Pattern.matcher(ip).matches(); }  static Integer rndInt(int lo, int hi); static Double rndDouble(double lo, double hi); static Integer rndPosInt(int lo, int hi); static String rndIp(); static Object rndChoice(List oList); static Object rndChoice(Object[] oArray); static String rndperc(); static final int ubyte2int(byte in); static final byte int2ubyte(int in); static boolean isValidIpv6String(String in); static final boolean isValidIpv4Subnet(String in); static boolean isValidIpv6Subnet(String in); static boolean isValidIpv4String(String in); static int nibble2int(byte nibble); static final byte int2nibble(int in); static String int16bit2hex(int i16); static int hex16bit2int(String in); static boolean IP4RegEx(String ip); static boolean IP6RegEx(String ip); static boolean IPRegEx(String ip); }
IPUtils { public static boolean IP6RegEx(String ip) { return ipv6Pattern.matcher(ip).matches(); }  static Integer rndInt(int lo, int hi); static Double rndDouble(double lo, double hi); static Integer rndPosInt(int lo, int hi); static String rndIp(); static Object rndChoice(List oList); static Object rndChoice(Object[] oArray); static String rndperc(); static final int ubyte2int(byte in); static final byte int2ubyte(int in); static boolean isValidIpv6String(String in); static final boolean isValidIpv4Subnet(String in); static boolean isValidIpv6Subnet(String in); static boolean isValidIpv4String(String in); static int nibble2int(byte nibble); static final byte int2nibble(int in); static String int16bit2hex(int i16); static int hex16bit2int(String in); static boolean IP4RegEx(String ip); static boolean IP6RegEx(String ip); static boolean IPRegEx(String ip);  }