Here you can find the source of chooseRandom(List
public static <T> T chooseRandom(List<T> list)
//package com.java2s; //License from project: Open Source License import java.util.List; import java.util.Random; public class Main { private static final Random seed = new Random(); public static <T> T chooseRandom(List<T> list) { return list.get(random(0, list.size() - 1)); }/*from w w w .j a v a2 s .co m*/ public static int random(int min, int max) { return seed.nextInt(max - min + 1) + min; } }