protected List<DiscoveryNode> validateNewNodes(Set<DiscoveryNode> nodes){
  for (Iterator<DiscoveryNode> it=nodes.iterator(); it.hasNext(); ) {
    DiscoveryNode node=it.next();
    if (!transportService.nodeConnected(node)) {
      try {
        logger.trace("connecting to node [{}]",node);
        transportService.connectToNode(node);
      }
 catch (      Throwable e) {
        it.remove();
        logger.debug("failed to connect to discovered node [" + node + "]",e);
      }
    }
  }
  return Collections.unmodifiableList(new ArrayList<>(nodes));
}

protected List < DiscoveryNode > validateNewNodes ( Set < DiscoveryNode > nodes ) { for ( Iterator < DiscoveryNode > it = nodes . iterator ( ) ; it . hasNext ( ) ; ) { DiscoveryNode node = it . next ( ) ; if ( ! transportService . nodeConnected ( node ) ) { try { logger . trace ( "connecting to node [{}]" , node ) ; transportService . connectToNode ( node ) ; } catch ( Throwable e ) { it . remove ( ) ; logger . debug ( "failed to connect to discovered node [" + node + "]" , e ) ; } } } return Collections . unmodifiableList ( new ArrayList < > ( nodes ) ) ; }
validates a set of potentially newly discovered nodes and returns an immutable list of the nodes that has passed .
