From the Java 6 TreeSet<E>
Documentation:
boolean remove(Object o):
Removes the specified element from this set if it is present.
Why does this accept an Object instead of the generic type E? The only objects that can be added are of type E, so it follows that the only removable type should be of type E.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…