question: public void testLongsCompare ( ) { BytesRef left = new BytesRef ( new byte [ Long . BYTES ] ) ; BytesRef right = new BytesRef ( new byte [ Long . BYTES ] ) ; for ( int i = 0 ; i < 10000 ; i ++ ) { long leftValue = TestUtil . nextLong ( random ( ) , Long . MIN_VALUE , Long . MAX_VALUE ) ; NumericUtils . longToSortableBytes ( leftValue , left . bytes , left . offset ) ; long rightValue = TestUtil . nextLong ( random ( ) , Long . MIN_VALUE , Long . MAX_VALUE ) ; NumericUtils . longToSortableBytes ( rightValue , right . bytes , right . offset ) ; assertEquals ( Integer . signum ( Long . compare ( leftValue , rightValue ) ) , Integer . signum ( left . compareTo ( right ) ) ) ; } }
target:  check sort order of random longs consistent with Long.compare 