Java tutorial
//package com.java2s; import java.util.Arrays; import java.util.List; import java.util.function.Predicate; public class Main { public static <T> boolean contains(T[] toFilter, Predicate<T> predicate) { return contains((List<T>) Arrays.asList(toFilter), predicate); } public static <T> boolean contains(List<T> toFilter, Predicate<T> predicate) { return toFilter.stream().anyMatch(predicate); } }