get n random elements from list java code example
Example: get n random elements from list java
List<Foo> list = createItSomehow();
Collections.shuffle(list);
Foo foo = list.get(0);
List<Foo> list = createItSomehow();
Collections.shuffle(list);
Foo foo = list.get(0);