public static < T > T randomElementOf ( final List < T > list ) { if ( list . isEmpty ( ) ) { return null ; } return list . get ( nextInt ( 0 , list . size ( ) ) ) ; }
Get a random element from the list .