static boolean less(int i, int j, long[] curr, long[] prev) {
        return prev[i] < prev[j] || prev[i] == prev[j] && curr[i] < curr[j];
    }
static boolean less ( int i , int j , long [ ] curr , long [ ] prev ) { return prev [ i ] < prev [ j ] || prev [ i ] == prev [ j ] && curr [ i ] < curr [ j ] ; }
Using the {@code prev} and {@code curr} invariants is value in index i
less than j. Value i is less than j if it was previously less than j
(prev[]) or it was equal and it is now (curr[]) less than j.

@param i    an index
@param j    an index
@param curr current invariants
@param prev previous invariants
@return is the value in index i less than j