Java tutorial
//package com.java2s; import java.util.*; import java.util.function.Predicate; public class Main { public static <E> boolean allMatch(List<E> elements, Predicate<E> predicate) { for (E element : elements) { if (!predicate.test(element)) { return false; } } return true; } }