public static long[] getLongIndexArray(int length) {
        long[] index = new long[length];
        for (int i=0; i<index.length; i++) {
            index[i] = i;
        }
        return index;
    }
public static long [ ] getLongIndexArray ( int length ) { long [ ] index = new long [ length ] ; for ( int i = 0 ; i < index . length ; i ++ ) { index [ i ] = i ; } return index ; }
Gets an array where array[i] = i.
@param length The length of the array.
@return The new index array.