Here you can find the source of pickupFromList(String[] list)
public static String pickupFromList(String[] list)
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { private static final Random _RAND = new Random(System.currentTimeMillis()); public static String pickupFromList(String[] list) { return list[getRandomNumberBelow(list.length)]; }//from w ww .j ava 2s . c o m public static int getRandomNumberBelow(int limit) { return _RAND.nextInt(limit); } }