Using Joi to validate method input, implementing test cases. Lodash no longer needed.