Recently I came up with idea to create a following method:
/** Returns a {@link Predicate} which tests whether all its elements match a condition passed as argument. */
private static <T> Predicate<Iterable<T>> allIterableElementsMatch(Predicate<T> elementMatchCondition) {
return iterable -> stream(iterable).allMatch(elementMatchCondition);
}
Then I decided to declare Function-field instead of declaring a method above.
The closest uncompilable solution I could provide is this one:
private static final Function<Predicate<?>, Predicate<Iterable<?>>> allIterableElementsMatch =
condition -> iterable -> stream(iterable).allMatch(condition);
This is not compiled (IDE highlights condition inside allMatch(...)) because of following reason:

My questions:
Function-s declaration just like in method I've shown?For the type system, ? from Predicate<?> and ? from Predicate<Iterable<?>> are different things. You can do:
private static <T> Function<Predicate<T>, Predicate<Iterable<T>>> func() {
return condition -> iterable -> StreamSupport.stream(iterable.spliterator(), false).allMatch(condition);
}