Use `checkArgument` instead of an if and throw.