Here you can find the source of getRandomInt(final int limit)
public static int getRandomInt(final int limit)
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { public static int getRandomInt(final int limit) { final Random randomGenerator = new Random(); final int randomInt = randomGenerator.nextInt(limit); return randomInt; }//from ww w. j a va 2 s . com }