Check out example codes for "get n random elements from list java". It will help you in understanding the concepts better.

Code Example 1

List<Foo> list = createItSomehow();
Collections.shuffle(list);
Foo foo = list.get(0);

Learn ReactJs, React Native from akashmittal.com