private Collection < SwimMember > selectRandomMembers ( int count , ImmutableMember exclude ) { List < SwimMember > members = this . members . values ( ) . stream ( ) . filter ( member -> ! member . id ( ) . equals ( localMember . id ( ) ) && ! member . id ( ) . equals ( exclude . id ( ) ) ) . collect ( Collectors . toList ( ) ) ; Collections . shuffle ( members ) ; return members . subList ( 0 , Math . min ( members . size ( ) , count ) ) ; }
Selects a set of random members excluding the local member and a given member .