Java tutorial
import java.util.function.Predicate; public class Main { public static void main(String... args) { Predicate<String> predicate = (s) -> s.length() > 0; predicate.test("foo"); // true predicate.negate().test("foo"); // false } }