private int addInterval(int index, int highestEndSeen) {
        int interval = intervals[index];
        long subqueryBitMap = subqueries[index];
        if (Interval.isZStar1Interval(interval)) {
            int begin = Interval.getZStar1Begin(interval);
            int end = Interval.getZStar1End(interval);
            if (highestEndSeen < begin) return -1;
            markSubquery(begin, end, ~subqueryMarkers[begin]);
            return end;
        } else {
            int begin = Interval.getBegin(interval);
            int end = Interval.getEnd(interval);
            if (highestEndSeen < begin -1) return -1;
            markSubquery(begin - 1, end, subqueryMarkers[begin - 1] & subqueryBitMap);
            return end;
        }
    }
Returns the end value of the interval,
or -1 if the highest end value seen is less than the interval begin.
predicate-search/src/main/java/com/yahoo/search/predicate/index/PredicateSearch.java