public static Function<Predicate, Predicate> and(Predicate presetPredicate) {
    return predicate -> new AndPredicate(presetPredicate, predicate);
  }
Creates a {@link Function} which, when called, creates an {@link AndPredicate} of
its input and the {@code presetPredicate}.  The function can then be used to transform
{@code Optional}s or streams.

@param presetPredicate this predicate will be AND-ed with the input to the {@code Function}
@return the {@code Function}
ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/Predicates.java