private Iterable<String> distinctNames(Iterable<InetSocketAddress> addresses){
  Set<String> result=new HashSet<>();
  for (  InetSocketAddress address : addresses) {
    result.add(name(address));
  }
  return result;
}

private Iterable < String > distinctNames ( Iterable < InetSocketAddress > addresses ) { Set < String > result = new HashSet < > ( ) ; for ( InetSocketAddress address : addresses ) { result . add ( name ( address ) ) ; } return result ; }
returns set with unique names .
