@Override
  public int occurrences(E element) {
    if (isDistinct) {
      return data.contains(element) ? 1 : 0;
    }
    // expensive!!
    int count = 0;
    /* this.base.iterator() */
    for (E v : this) {
      if (element == null ? v == null : element.equals(v)) {
        count++;
      }
    }
    return count;
  }
The n - way merge results returns a sorted results on the cumulative sorted results for
partitioned region based query
geode-core/src/main/java/org/apache/geode/cache/query/internal/NWayMergeResults.java