question: private Collection < InetSocketAddress > filterIfNecessary ( Collection < InetSocketAddress > addrs , boolean filter ) { if ( ! filter ) return addrs ; List < InetSocketAddress > res = new ArrayList < > ( addrs . size ( ) ) ; for ( InetSocketAddress addr : addrs ) if ( ! addr . isUnresolved ( ) ) res . add ( addr ) ; return res ; }
target:  Filters sockets with resolved addresses.