I don't understand these complaints.
Here is a tiny interface that will do what you need:
@FunctionalInterface
public interface IPasswordChecker
{
bool isValid(String password);
}
Now you can trivially declare a lambda that implements the interface.Example:
const IPasswordChecker passwordChecker = (String password) -> password.length() >= 16;