LongRangeSet (LongRangeType lrType) { if (myFrom >= 0) return this; long minValue = lrType.min(); long low = myFrom, hi = myTo; if (low <= minValue) { low = minValue + 1; } if (myTo <= 0) { hi = -low; low = -myTo; } else { hi = Math.max(-low, hi); low = 0; } if (low > hi) { return lrType.fullRange(); } if (myFrom <= minValue) { return new RangeSet(new long[]{minValue, minValue, low, hi}); } else { return new Range(low, hi); } }