private static List<Predicate> distribute(Predicate left, Predicate right) {

    if (left instanceof OrPredicate) {
      return distributeOr((OrPredicate) left, right);
    }

    if (right instanceof OrPredicate) {
      return distributeOr((OrPredicate) right, left);
    }
    return Collections.singletonList(left.equals(right) ?
        left : AndPredicate.instance(left, right));
  }
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