I am converting a List<City>
into a Map<CityType, Set<City>>
.
City within it has fields like CityIdentifier, State, Latitude
etc.
CityIdentifier
within it has a cityName
& cityType
.
For the above conversion, for the Collectors.groupingBy
, I need a function like City::getCityType
. Can I use the getter from CityIdentifier
i.e. something like City::getCityIdentifier.getCityType
?