@Test public void validateHostPortList_ok_ipv4_lookalike_hostname() { List<InetSocketAddress> validHosts = InetSocketAddressConverter.getInetSocketAddresses( new String[]{ "10.10.10", "10.10.10.10.10", "999.10.10.400", "10-10-10-10" }); InetSocketAddress server1 = InetSocketAddress.createUnresolved("10.10.10", 0); InetSocketAddress server2 = InetSocketAddress.createUnresolved("10.10.10.10.10", 0); InetSocketAddress server3 = InetSocketAddress.createUnresolved("999.10.10.400", 0); InetSocketAddress server4 = InetSocketAddress.createUnresolved("10-10-10-10", 0); assertThat(validHosts, hasItems(server1, server2, server3, server4)); }
public static List<InetSocketAddress> getInetSocketAddresses(String[] servers) { return getInetSocketAddresses(servers, 0); }
InetSocketAddressConverter { public static List<InetSocketAddress> getInetSocketAddresses(String[] servers) { return getInetSocketAddresses(servers, 0); } }
InetSocketAddressConverter { public static List<InetSocketAddress> getInetSocketAddresses(String[] servers) { return getInetSocketAddresses(servers, 0); }  }
InetSocketAddressConverter { public static List<InetSocketAddress> getInetSocketAddresses(String[] servers) { return getInetSocketAddresses(servers, 0); }  static InetSocketAddress getInetSocketAddress(String server); static InetSocketAddress getInetSocketAddress(String hostPort, int defaultPort); static List<InetSocketAddress> getInetSocketAddresses(String[] servers); static List<InetSocketAddress> getInetSocketAddresses(String[] servers, int defaultPort); static String toHostPort(InetSocketAddress address); }
InetSocketAddressConverter { public static List<InetSocketAddress> getInetSocketAddresses(String[] servers) { return getInetSocketAddresses(servers, 0); }  static InetSocketAddress getInetSocketAddress(String server); static InetSocketAddress getInetSocketAddress(String hostPort, int defaultPort); static List<InetSocketAddress> getInetSocketAddresses(String[] servers); static List<InetSocketAddress> getInetSocketAddresses(String[] servers, int defaultPort); static String toHostPort(InetSocketAddress address);  }