A question about a generic method



Hello,

The fill method in java.util.Collections has this signature:
<T> void fill(List<? super T> list, T obj)

I can't understand why the signature is not this one:
<T> void fill(List<T> list, T obj)
because with this last one you can call the method with these arguments (Employee extends Person):
List<Person> l = new ArrayList<Person>();
l.add(new Person("john"));
l.add(new Person("bob"));
Employee e = new Employee("fred", 1000);
Coll.fill(l, e);

(T is inferred into Person).

I can't find circumstances where the first signature is better than the last one. Could you show me one?

Thanks in advance for your answer.

Richard
.