public static String getSimpleClassName(Class cls) {
    return cls.getName().substring(cls.getPackage().getName().length() + 1);
  }
evaluate as a filter, involving a two independent iterators. Use an index if possible on both.
And merge theresults obtained.
geode-core/src/main/java/org/apache/geode/cache/query/internal/CompiledComparison.java