private List < String > hostsThatAreUp ( List < String > hosts ) { List < String > upHosts = new ArrayList <> ( ) ; for ( String host : hosts ) { if ( isUpOrCouldBeRetried ( host ) ) { upHosts . add ( host ) ; } } return upHosts . isEmpty ( ) ? hosts : upHosts ; }
Get the hosts that are not considered down in a given list .