private static Predicate transform(Predicate predicate) {
        if (predicate instanceof Conjunction) {
            Conjunction conjunction = (Conjunction) predicate;
            conjunction.getOperands().replaceAll(FeatureConjunctionTransformer::transform);
            long nValidOperands = numberOfValidFeatureSetOperands(conjunction);
            if (nValidOperands > 1 && nValidOperands <= CONVERSION_THRESHOLD) {
                return convertConjunction(conjunction, nValidOperands);
            }
        } else if (predicate instanceof Disjunction) {
            ((Disjunction)predicate).getOperands().replaceAll(FeatureConjunctionTransformer::transform);
        } else if (predicate instanceof Negation) {
            Negation negation = (Negation) predicate;
            negation.setOperand(transform(negation.getOperand()));
        }
        return predicate;
    }
Transforms Conjunctions with only (negated) {@link FeatureSet} instances to {@link FeatureConjunction}.
The {@link FeatureConjunction}s are indexed by the {@link ConjunctionIndex}.

@author bjorncs
predicate-search/src/main/java/com/yahoo/search/predicate/optimization/FeatureConjunctionTransformer.java