probably better to do
```scala
require(key != null, "key cannot be null")
require(value != null, "value cannot be null for key " + key)
```