public static Predicate instance(Predicate... predicates) {
    List<Predicate> predicateList = new LinkedList<>();

    // Simplify the predicate array
    for (Predicate predicate : predicates) {
      if (!(predicate instanceof AlwaysPredicate)) {
        if (predicate instanceof AndPredicate) {
          predicateList.addAll(Arrays.asList(((AndPredicate) predicate).getPredicates()));
        }
        else {
          predicateList.add(predicate);
        }
      }
    }

    return predicateList.size() == 1 ?
        predicateList.get(0) :
        new AndPredicate(predicateList.toArray(new Predicate[predicateList.size()]));
  }
Predicate which evaluates to true if all of the predicates in a predicate
array evaluate to true.
ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/AndPredicate.java