IPTools { public static boolean isIPv6Address(final String address) { return address != null && (isIPv6StdAddress(address) || isIPv6HexCompressedAddress(address)); } private  IPTools(); static boolean isIPv4Address(final String address); static boolean isIPv6StdAddress(final String address); static boolean isIPv6HexCompressedAddress(final String address); static boolean isIPv6Address(final String address); static InetAddress getLocalIPv4Address(); static ArrayList<InetAddress> getLocalIPv4Addresses(); static boolean isIpAddressLocalhost(InetAddress addr); static boolean isIpAddressLocalNetwork(InetAddress addr);  }
@Test public void testIsIPv6Address() { assertIPv6Address(getIPv4Addresses(), false); assertIPv6Address(getIPv6Addresses(), true); assertIPv6Address(getInvalidIpAddresses(), false); }