import java.util.function.Predicate; class X { Predicate predicate() { return s -> !s.isEmpty() && test(s) > 0; } int test(String s) { return s.length() + s.charAt(0); } }