String st ;
boolean b ;
Predicate<String> notEmpty = (x) -> x.length() > 0;
Predicate<String> nonNull = (x) -> x != null;
Predicate<String> isEmpty = String::isEmpty;
Predicate<String> isNotEmpty = isEmpty.negate();

void test() {
b = notEmpty.test(st); //true
b = notEmpty.negate().test(st); //false
b = nonNull.and(notEmpty).test(st);
b = isEmpty.test(st);
b = isNotEmpty.test(st);
}

استفاده از اینترفیس فوق العاده Predicate