private List < String > getRotatedList ( List < String > strings ) { int index = RANDOM . nextInt ( strings . size ( ) ) ; List < String > rotated = new ArrayList < String > ( ) ; for ( int i = 0 ; i < strings . size ( ) ; i ++ ) { rotated . add ( strings . get ( index ) ) ; index = ( index + 1 ) % strings . size ( ) ; } return rotated ; }
Rotate list of String . Used for randomize selection of received endpoints