docs: static <T extends CompoundPredicate> T flattenCompound(Predicate predicateLeft, Predicate predicateRight, Class<T> klass) {
          // The following could have been achieved with {@link com.hazelcast.query.impl.predicates.FlatteningVisitor},
          // however since we only care for 2-argument flattening, we can avoid constructing a visitor and its internals
          // for each token pass at the cost of the following explicit code.
          Predicate[] predicates;
          if (klass.isInstance(predicateLeft) || klass.isInstance(predicateRight)) {
              Predicate[] left = getSubPredicatesIfClass(predicateLeft, klass);
              Predicate[] right = getSubPredicatesIfClass(predicateRight, klass);
  
              predicates = new Predicate[left.length + right.length];
              ArrayUtils.concat(left, right, predicates);
          } else {
              predicates = new Predicate[]{predicateLeft, predicateRight};
          }
          try {
              CompoundPredicate compoundPredicate = klass.newInstance();
              compoundPredicate.setPredicates(predicates);
              return (T) compoundPredicate;
          } catch (InstantiationException e) {
              throw new RuntimeException(String.format("%s should have a public default constructor", klass.getName()));
          } catch (IllegalAccessException e) {
              throw new RuntimeException(String.format("%s should have a public default constructor", klass.getName()));
          }
      }