@Override
    public boolean nextInterval() {
        int nextInterval = -1;
        if (currentIntervalIndex < currentIntervals.length) {
            nextInterval = currentIntervals[currentIntervalIndex];
        }
        if (prevInterval != 0) {
            if (Interval.isZStar2Interval(nextInterval)) {
                this.currentInterval = Interval.combineZStarIntervals(prevInterval, nextInterval);
                ++currentIntervalIndex;
            } else {
                int end = Interval.getZStar1End(prevInterval);
                this.currentInterval = Interval.fromZStar1Boundaries(end, end + 1);
            }
            prevInterval = 0;
            return true;
        } else if (nextInterval != -1) {
            this.currentInterval = nextInterval;
            ++currentIntervalIndex;
            prevInterval = nextInterval;
            return true;
        }
        return false;
    }
@param docIds Posting list as a stream.
predicate-search/src/main/java/com/yahoo/search/predicate/index/ZstarCompressedPostingList.java