import java.util.function.Predicate; class Foo { Predicate test(int i) { return switch (i) { default -> String::isEmpty; }; } }