/** * Returns true if the predicate2 and parameter evaluates to true for any element of the iterable. * Returns false if the iterable is empty or if no elements return true for the predicate2. */ public static <T, P> boolean anySatisfyWith( Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter) { if (iterable instanceof MutableCollection) { return ((MutableCollection<T>) iterable).anySatisfyWith(predicate, parameter); } if (iterable instanceof ArrayList) { return ArrayListIterate.anySatisfyWith((ArrayList<T>) iterable, predicate, parameter); } if (iterable instanceof RandomAccess) { return RandomAccessListIterate.anySatisfyWith((List<T>) iterable, predicate, parameter); } if (iterable != null) { return IterableIterate.anySatisfyWith(iterable, predicate, parameter); } throw new IllegalArgumentException("Cannot perform an anySatisfyWith on null"); }
/** * Returns true if the predicate2 and parameter evaluates to true for any element of the iterable. * Returns false if the iterable is empty or if no elements return true for the predicate2. */ public static <T, P> boolean anySatisfyWith( Iterable<T> iterable, Predicate2<? super T, ? super P> predicate, P parameter) { if (iterable instanceof MutableCollection) { return ((MutableCollection<T>) iterable).anySatisfyWith(predicate, parameter); } if (iterable instanceof ArrayList) { return ArrayListIterate.anySatisfyWith((ArrayList<T>) iterable, predicate, parameter); } if (iterable instanceof RandomAccess) { return RandomAccessListIterate.anySatisfyWith((List<T>) iterable, predicate, parameter); } if (iterable != null) { return IterableIterate.anySatisfyWith(iterable, predicate, parameter); } throw new IllegalArgumentException("Cannot perform an anySatisfyWith on null"); }