static public long[] randomLongs(long start, long end, int size){
		Preconditions.checkArgument(start < end, "Start must be less than end.");
		
		Random random = new Random();
		random.setSeed(System.currentTimeMillis());
		long[] result = new long[size];
		for (int i = 0; i < size; i ++){
			long l = random.nextLong();
			double d = (double)(end - start) / (Long.MAX_VALUE - Long.MIN_VALUE) * l + start;
			if (d <= start){
				l = start;
			}else if (d >= end){
				l = end;
			}else{
				l = (long)d;
			}
			result[i] = l;
		}
		return result;
	}
static public long [ ] randomLongs ( long start , long end , int size ) { Preconditions . checkArgument ( start < end , "Start must be less than end." ) ; Random random = new Random ( ) ; random . setSeed ( System . currentTimeMillis ( ) ) ; long [ ] result = new long [ size ] ; for ( int i = 0 ; i < size ; i ++ ) { long l = random . nextLong ( ) ; double d = ( double ) ( end - start ) / ( Long . MAX_VALUE - Long . MIN_VALUE ) * l + start ; if ( d <= start ) { l = start ; } else if ( d >= end ) { l = end ; } else { l = ( long ) d ; } result [ i ] = l ; } return result ; }
Generate random long values
@param start	the minimum value of the generated numbers, inclusive
@param end  the maximum value of the generated numbers, inclusive
@param size  number of random numbers to return. a.k.a. the size of the returned array.
@return  the random values in an array. The values are guaranteed to be within [start, end] range.