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