Using a Java method as a Predicate