Here you can find the source of randomLongWithMinMax(long min, long max)
public static long randomLongWithMinMax(long min, long max)
//package com.java2s; //License from project: Apache License public class Main { public static long randomLongWithMinMax(long min, long max) { return (long) (min + (Math.random() * (max - min + 1))); }/*from w ww . j a va2 s . co m*/ }