docs: @SuppressWarnings("unchecked")
      private static void validateSelector(Map<String, Object> selector) throws QueryException {
          String topLevelOp = (String) selector.keySet().toArray()[0];
  
          // top level op can only be $and or $or after normalisation
          if (topLevelOp.equals(AND) || topLevelOp.equals(OR)) {
              Object topLevelArg = selector.get(topLevelOp);
              if (topLevelArg instanceof List) {
                  // safe we know its a List
                  validateCompoundOperatorClauses((List<Object>) topLevelArg,
                                                         new Boolean[]{ false });
              }
          }
      }