From https://docs.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html:
Note that to take advantage of automatic type inference during generic
class instantiation, you must specify the diamond. [...] The HashMap() constructor refers to the HashMap raw type, not
the Map> type.