Throwing a `NullPointerException` if there is no `null` is involved if wrong. Yes, I know you’re only working with what’s there but while you’re at it, turn this into an appropriate exception, such as `InvalidArgumentException`. (Don’t forget to check the places where this method is called.)