there is a location class Place, whose constructor is Place (String name, Position p, String description), and the constructor of coordinate Position class is Position (int x, int y).
now there is a collection of Place objects HashSet < Place > places=new HashSet < > ();. Because a name name may correspond to multiple different Place objects, in order to facilitate the query by place name, we want to arrange the places with the same name, that is, to organize the location objects into a map: Map < String, Set < Place > > map=new HashMap < > (). How to get map? from the existing collection places? Where the key of map is a string, which is the name of the place, and value is the Set collection of Place with the corresponding name. Thank you in advance!