The map is the core of the factory. GenericFactory should instantiate it's own map (as it's standard practice) instead of providing a setter for.
There are many reasons for this:
- the map is not an optional collaborator for the factory but a required one without which the factory cannot function
- simplifies the API
- each time the setter is used in the current codebase, it's used simply to inject an empty HashMap