bson/src/main/org/bson/internal/UnsignedLongs.java
public static int compare(final long first, final long second) {
        return compareLongs(first + Long.MIN_VALUE, second + Long.MIN_VALUE);
    }
public static int compare(final long first, final long second) {
        return compareLongs(first + Long.MIN_VALUE, second + Long.MIN_VALUE);
    }
Equivalent of Long.compareUnsigned in Java 8.

@param first  the first value
@param second the second value
@return 0 if the values are equal, a value greater than zero if first is greater than second,
a value less than zero if first is less than second