@Override
  public boolean add(Object element) {
    if (limit > -1) {
      throw new UnsupportedOperationException(
          "Addition to the SelectResults not allowed as the query result is constrained by LIMIT");
    }
    if (element == null) {
      numNulls++;
    } else {
      int count = mapGet(element); // 0 if not
                                   // found
      mapPut(element, count + 1);
    }
    size++;
    assert size >= 0 : size;
    return true;
  }
Return an iterator over the elements in this collection. Duplicates will show up the number of
times it has occurrences.
geode-core/src/main/java/org/apache/geode/cache/query/internal/Bag.java