- @VisibleForTesting
- public UnsignedLong upper() {
- return UnsignedLong.fromLongBits(upperBits);
- }
-
- boolean contains(final long longBits) {
- return Long.compareUnsigned(lowerBits, longBits) <= 0 && Long.compareUnsigned(upperBits, longBits) >= 0;
- }
-
- Entry copy() {
- return new Entry(lowerBits, upperBits);
- }
-
- // Provides compatibility with RangeSet<UnsignedLong> using [lower, upper + 1)
- Range<UnsignedLong> toUnsigned() {
- return Range.closedOpen(UnsignedLong.fromLongBits(lowerBits), UnsignedLong.fromLongBits(upperBits + 1));
+ @NonNull Entry withUpper(final long newUpperBits) {
+ return of(lowerBits, newUpperBits);