@Override
      public boolean hasNext() {
        if (cachedHasNext != null) {
          return cachedHasNext;
        }
        boolean hasNext = false;

        for (int i = currentIterator; i < iterators.length; ++i) {
          if (iterators[i].hasNext()) {
            hasNext = true;
            currentIterator = i;
            break;
          }
        }
        cachedHasNext = hasNext;
        return hasNext;
      }
This is used as a wrapper over all the results of PR which are of non distinct type
geode-core/src/main/java/org/apache/geode/cache/query/internal/CumulativeNonDistinctResults.java