Here you can find the source of getBoolean()
public static boolean getBoolean()
//package com.java2s; import java.util.Random; public class Main { private static final Random RANDOM = new Random(); /**/*from w w w . ja v a 2 s . c o m*/ * Gets a random boolean. * * @return random boolean. */ public static boolean getBoolean() { return RANDOM.nextInt(1) == 1; } }