IpUtils { public static boolean checkValidV6(final String ip) { return isNotEmpty(ip) && IP_V6_ADDRESS_IS_VALID.matcher(ip).matches(); } private  IpUtils(); static boolean checkValid(final String ip); static boolean checkValid2(final String ip); static boolean checkValidV6(final String ip); static String removeTail32(String ip); static String extractDomain(String url); static String getTailFromURL(String url); static long ip2long(String ipAddress); static String long2ip(Long ipAddress); static Integer ip2int(String ipAddress); static Boolean checkIPRange(final String ipAddress, final String range); static String getIPFromURL(String url); static Boolean isReachable(final String ipAddress); static boolean ping(final String ipAddress); static List<String> getCurrentEnvironmentNetworkIps();  }
@Test public void checkValidTestV6() { assertTrue(checkValidV6("2001:0db8:0000:0000:0000:ff00:0042:8329")); assertTrue(checkValidV6("2001:db8:0:0:0:ff00:42:8329")); assertTrue(checkValidV6("0000:0000:0000:0000:0000:0000:0000:0001")); assertTrue(checkValidV6("::1")); assertFalse(checkValidV6("2001:0db8:0000:0000:0000:ff00:0042:83299")); assertFalse(checkValidV6("::11111")); }