IPTools { public static boolean isIpAddressLocalNetwork(InetAddress addr) { return addr != null && addr.isSiteLocalAddress(); } 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 testLocalAddressesNetwork() throws UnknownHostException { assertFalse(IPTools.isIpAddressLocalNetwork(InetAddress.getByName("8.8.8.8"))); }