/** Returns a predicate for a collection which is true if * there is at least one element in the collection given to the predicate * which satisfies the predicate given here. */ public static <T,TT extends Iterable<T>> Predicate<TT> any(Predicate<T> attributeSatisfies) { // implementation could be more efficient -- ie succeed fast return quorum(QuorumChecks.atLeastOne(), attributeSatisfies); }
/** * Returns a predicate for a collection which is true if * all elements in the collection given to the predicate * which satisfies the predicate given here. * <p> * This will return true for the empty set. * To require additionally that there is at least one * use {@link #quorum(QuorumCheck, Predicate)} with * {@link QuorumChecks#allAndAtLeastOne()}. */ public static <T,TT extends Iterable<T>> Predicate<TT> all(Predicate<T> attributeSatisfies) { return quorum(QuorumChecks.all(), attributeSatisfies); }