public static class CollectionUtil.DefaultingMap<K,V>
A defaulting map, which returns a default value when a value that does not exist in the map is looked up.
This map supports two modes: injecting-on-default, and not injecting-on-default. When injecting on default, when a lookup is
performed and a default value is returned, the default value is injected at that key, so that it now lives in the underlying map.
Without this mode, the value is simply returned and the underlying map is unaffected.
Note: When using injecting-on-default mode, and performing a lookup with a non-key type (the get method accepts any object), a
class cast exception will be thrown because a non-key type cannot be added to the map.
Creates a defaulting map that generates defaults from the provided factory. This is useful when the default is non-static, or
the default is mutable, and the client wishes to get a value and mutate it and persist those changes in the map.