Here you can find the source of generateRandomInt(final int max)
public static int generateRandomInt(final int max)
//package com.java2s; public class Main { public static int generateRandomInt(final int max) { return (int) (Math.random() * max); }/*from www. j a va 2s. c o m*/ }