private void checkConstraint(Object obj) {
    ObjectType elementType = collectionType.getElementType();
    if (!elementType.resolveClass().isInstance(obj)) {
      throw new InternalGemFireError(
          String.format("Constraint Violation: %s is not a %s",
              obj.getClass().getName(), elementType));
    }
  }
no-arg constructor required for DataSerializable
geode-core/src/main/java/org/apache/geode/cache/query/internal/ResultsCollectionWrapper.java