@Override
  public int occurrences(Object element) {
    if (!(element instanceof Struct)) {
      return 0;
    }
    Struct s = (Struct) element;
    if (!elementType.equals(StructTypeImpl.typeFromStruct(s))) {
      return 0;
    }
    if (hasLimitIterator) {
      int count = 0;
      boolean encounteredObject = false;
      Object[] fields = s.getFieldValues();
      for (Iterator itr = fieldValuesIterator(); itr.hasNext();) {
        Object[] structFields = (Object[]) itr.next();
        if (Arrays.equals(fields, structFields)) {
          count++;
          encounteredObject = true;
        } else if (encounteredObject) {
          // Asif: No possibility of its occurrence again
          break;
        }
      }
      return count;
    } else {
      return mapGet(s.getFieldValues()); // returns 0 if not found
    }
  }
Does this set contain a Struct of the correct type with the specified values?
geode-core/src/main/java/org/apache/geode/cache/query/internal/SortedStructBag.java