ObjectType getCollectionElementTypeCast() throws TypeMismatchException {
    ObjectType typ = collectionExpr.getTypecast();
    if (typ != null) {
      if (!(typ instanceof CollectionType)) {
        throw new TypeMismatchException(
            String.format("An iterator definition must be a collection type, not a %s",
                typ));
      }
      if (typ instanceof MapType) { // we iterate over map entries
        return ((MapType) typ).getEntryType();
      }
      return ((CollectionType) typ).getElementType();
    }
    return null;
  }
Returns a RuntimeIterator (or null if evaluates to null or UNDEFINED); the collection expr is
evaluated lazily after dependencies are known
geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledIteratorDef.java