Here you can find the source of getRandomInt(int size)
public static int getRandomInt(int size)
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { static final Random rand = new Random(); public static int getRandomInt(int size) { return rand.nextInt(size + 1); }/*from w ww. j a va2 s . c o m*/ }