HostnameUtil { public static Set<String> getHostnames(String address) { return getHostnames(address, true); }  static String getHostname(); static Set<String> getHostnames(String address); static Set<String> getHostnames(String address, boolean includeLoopback);  }
@Test public void testGetHostnames_ExcludeLocal() throws Exception { Set<String> hostnames = HostnameUtil.getHostnames("0.0.0.0", false); hostnames.forEach(hostname -> { assertNotEquals(hostname, "127.0.0.1"); assertNotEquals(hostname, "localhost"); System.out.println(hostname); }); }