Here you can find the source of range(long start, long end)
public static long[] range(long start, long end)
//package com.java2s; //License from project: LGPL public class Main { public static long[] range(long start, long end) { long[] values = new long[(int) Math.abs(end - start) + 1]; if (end < start) { long oldstart = start; start = end;//from www. j a v a 2s. c om end = oldstart; } for (long i = start; i <= end; i++) { values[(int) (i - start)] = i; } return values; } }