Here you can find the source of getRandomInt(int a, int b)
public static int getRandomInt(int a, int b)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ThreadLocalRandom; public class Main { public static int getRandomInt(int a, int b) { if (a == b) return a; if (a > b) return ThreadLocalRandom.current().nextInt(b, a); return ThreadLocalRandom.current().nextInt(a, b); }/* w w w.ja va 2s . c o m*/ }