@Test public void validateHostPortList_ok_ipv6() { List<InetSocketAddress> validServers = InetSocketAddressConverter.getInetSocketAddresses( new String[]{ "[2001:db8:a0b:12f0:0:0:0:1]:9510", "2001:db8:a0b:12f0:0:0:0:1", "[2001:db8:a0b:12f0:0:0:0:1]", "[2001:db8:a0b:12f0::1]:9510", "2001:db8:a0b:12f0::1", "[::1]:9510", "::1", "[::1]", "[2001:db8::]:9510", "2001:db8::" }); InetSocketAddress server1 = InetSocketAddress.createUnresolved("[2001:db8:a0b:12f0:0:0:0:1]", 9510); InetSocketAddress server2 = InetSocketAddress.createUnresolved("2001:db8:a0b:12f0:0:0:0:1", 0); InetSocketAddress server3 = InetSocketAddress.createUnresolved("[2001:db8:a0b:12f0:0:0:0:1]", 0); InetSocketAddress server4 = InetSocketAddress.createUnresolved("[2001:db8:a0b:12f0::1]", 9510); InetSocketAddress server5 = InetSocketAddress.createUnresolved("2001:db8:a0b:12f0::1", 0); InetSocketAddress server6 = InetSocketAddress.createUnresolved("[::1]", 9510); InetSocketAddress server7 = InetSocketAddress.createUnresolved("::1", 0); InetSocketAddress server8 = InetSocketAddress.createUnresolved("[::1]", 0); InetSocketAddress server9 = InetSocketAddress.createUnresolved("[2001:db8::]", 9510); InetSocketAddress server10 = InetSocketAddress.createUnresolved("2001:db8::", 0); assertThat(validServers, hasItems(server1, server2, server3, server4, server5, server6, server7, server8, server9, server10)); }
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);  }