### Question:
IpUtils { public static List<InetSocketAddress> parseAddresses(List<String> addresses) { List<InetSocketAddress> result = new ArrayList<>(); if(CollectionUtils.isNotEmpty(addresses)) { for(String a : addresses) { InetSocketAddress res = parseAddress(a); if (res != null) { result.add(res); } } } return result; }  static InetSocketAddress parseAddress(String address); static List<InetSocketAddress> parseAddresses(List<String> addresses);  }### Answer:
@Test public void parseAddresses() { List<String> addresses = new ArrayList<>(); addresses.add(IPV6_WITH_PORT); addresses.add(IPV6_NO_PORT); addresses.add(IPV6_INVALID); addresses.add(IPV4_WITH_PORT); addresses.add(IPV4_NO_PORT); List<InetSocketAddress> result = IpUtils.parseAddresses(addresses); Assert.assertTrue(CollectionUtils.isNotEmpty(result)); Assert.assertEquals(2, CollectionUtils.size(result)); }