@Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if ( ! super.equals(o)) return false;
        MultiRangeItem<?> that = (MultiRangeItem<?>) o;
        return    type == that.type
               && startInclusive == that.startInclusive
               && endInclusive == that.endInclusive
               && startIndex.equals(that.startIndex)
               && endIndex.equals(that.endIndex)
               && sortedRanges().equals(that.sortedRanges());
    }
Assumption: first.start <= second.start
Then there is overlap if
first.end  > second.start
first.end == second.start AND either of
  ranges are inclusive at either end, OR
  either range is a (logically empty) point (a, a), since this dominated by (or equal to) the other range.
container-search/src/main/java/com/yahoo/prelude/query/MultiRangeItem.java