boolean (LongRangeSet other) { if (other.isEmpty()) return false; if (other instanceof RangeSet) { long[] otherRanges = ((RangeSet)other).myRanges; for (int i = 0; i < otherRanges.length && otherRanges[i] <= myTo; i += 2) { if (myTo >= otherRanges[i] && myFrom <= otherRanges[i + 1]) return true; } return false; } return myTo >= other.min() && myFrom <= other.max(); }