Its a good programming practice to avoid having null
values in a Map.
If you have an entry with null
value, then it is not possible to tell whether an entry is present in the map or has a null
value associated with it.
You can either define a constant for such cases (Example: String NOT_VALID = "#NA"
), or you can have another collection storing keys which have null
values.
Please check this link for more details.