Here you can find the source of getElement(boolean[] array)
public static boolean getElement(boolean[] array)
//package com.java2s; //License from project: Apache License import java.util.List; import java.util.concurrent.ThreadLocalRandom; public class Main { public static boolean getElement(boolean[] array) { return array[getInt(array.length)]; }/* ww w .j a v a 2 s.co m*/ public static byte getElement(byte[] array) { return array[getInt(array.length)]; } public static char getElement(char[] array) { return array[getInt(array.length)]; } public static short getElement(short[] array) { return array[getInt(array.length)]; } public static int getElement(int[] array) { return array[getInt(array.length)]; } public static long getElement(long[] array) { return array[getInt(array.length)]; } public static float getElement(float[] array) { return array[getInt(array.length)]; } public static double getElement(double[] array) { return array[getInt(array.length)]; } public static <E> E getElement(E[] array) { return array[getInt(array.length)]; } public static <E> E getElement(List<E> list) { return list.get(getInt(list.size())); } public static int getInt() { return ThreadLocalRandom.current().nextInt(); } public static int getInt(int bound) { return ThreadLocalRandom.current().nextInt(bound); } public static int getInt(int min, int max) { return getInt(max + 1 - min) + min; } }