Fix generic types map creation and unit test for that

This is the same thing I did previously for collections, but overlooked for maps:
Try to find a constructor to create non-empty map;
Avoid loosing supplied generic type arguments while creating maps.