private static List<Predicate> distributeOr(OrPredicate orPredicate, Predicate other) {
    List<Predicate> andPredicateList = new LinkedList<>();
    OrPredicate otherOr = null;

    if (other instanceof OrPredicate) {
      otherOr = (OrPredicate) other;
    }

    for (Predicate basePredicate : orPredicate.getPredicates()) {

      if (otherOr != null) {
        andPredicateList.addAll(distributeOr(otherOr, basePredicate));
      }
      else {
        andPredicateList.add(basePredicate.equals(other) ?
            basePredicate : AndPredicate.instance(basePredicate, other));
      }
    }
    return andPredicateList;
  }
Obtain a list of simplified predicates based on the rules described in the class documentation.

@return a list of simplified predicates
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/SimplifyingPredicateVisitor.java