I've read the Beautiful code with Google Collections, Guava and static imports article about Java collections, and the following snippet got my attention:
Map<String, Map<Long, List<String>>> map = Maps.newHashMap();
The thing is, I don't understand how it's possible that the newHashMap
method can return a Map<String,Map<Long, List<String>>>
. How did they write this code? When did it became possible? I lived under the impression that you need to explicitly declare the generics parameters in the constructor call.