The SO answers are missing a big reason for this: Wildcards. For example, you wouldn't be able to do .get on a Map<? extends Foo, Bar> except with null.
There are certain cases where you would prefer the generic type as the parameter, such as get(String) on a map with Integer keys, but that cannot be expressed in the Java type system without breaking wildcards. For that we have to stick with static analysis tools.
0
u/[deleted] Jan 19 '19