We can eliminate D, because the keys in Map must be unique, which are not executed for EUROPE.
We can exclude Cdue to order in [Germany, Italy]. Italywas placed in front of Germanythe list, so it should also be stored in that order in the list of results.
, B A? , .
-. -, LinkedHashMap, , TreeMap, Collectors.groupingBy.
, HashMap, - hashCode() (Country.Continent enum here) , . hashCode() Enum Object, , , JVM, , - ( , ).
, - Map, groupingBy, , A, B.