@Override
  public boolean retainAll(Collection collection) {
    /*
     * if( this.limit > -1) { throw new UnsupportedOperationException("Modification of the
     * SelectResults not allowed as the query result is constrained by LIMIT"); }
     */
    if (hasLimitIterator) {
      Iterator itr = iterator();
      boolean changed = false;
      Object element;
      while (itr.hasNext()) {
        element = itr.next();
        if (!collection.contains(element)) {
          itr.remove();
          changed = true;
        }
      }
      return changed;
    } else {
      return retainAll(collection);
    }
  }
no-arg constructor required for DataSerializable
geode-core/src/main/java/org/apache/geode/cache/query/internal/ResultsCollectionWrapper.java