1public static <T> T getRandomValue(List<T> listOfPossibleOutcomes, int numPossibilities) {
2 int r = RandomNumberGenerator.getRandIntBetween(0, numPossibilities);
3 return listOfPossibleOutcomes.get(r);
4}
5
6public static <T> T getRandomValueFromGenericList(List<T> list) {
7 Collections.shuffle(list);
8 return list.get(0);
9}