Here you can find the source of getRandom()
public static int getRandom()
//package com.java2s; import java.util.concurrent.atomic.AtomicInteger; public class Main { private static AtomicInteger serial = new AtomicInteger(0); public static int getRandom() { return serial.getAndIncrement(); }/*from w w w . j a v a2s. co m*/ }