Here you can find the source of randPosLong()
public static long randPosLong()
//package com.java2s; public class Main { /**//ww w .ja v a 2 s .c o m * simply uses Math.random, only 0 and positive longs returned * */ public static long randPosLong() { return randPosLong(Long.MAX_VALUE); } /** * simply uses Math.random, only 0 and positive returned. Possibly not all * long values can be returned, check details of java random. * */ public static long randPosLong(long max) { return (long) (Math.random() * max); } }