Providing the validation function as a first class function (i.e. something you can put in a variable) is just fine, Java just makes it a bit harder (and seem way harder because lots of old ...