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