I would insert precondition checks for the parameters here such as, if they are null, throw IllegalArgumentException.