According to this entry in the Java Generics FAQ, there are some circumstances where a generic method has no equivalent non-generic method that uses wildcard types. According
These are not quite the same:
> void f(Class x) {}
void g(Class extends Iterable>> x) {}
The difference is that g
accepts a "Class of unknown that implements Iterable of unknown", but ArrayList
is constrained implementing Iterable
, not Iterable>
, so it doesn't match.
To make it clearer, g
will accept Foo implements Iterable>
, but not AraryList
.