Helper to return a defaultValue when getting maybe null keys from a map.
the type of the map key
the type of the map value