posted 16 years ago
On a side note, it is a bad idea to use any highly mutable object (like Lists, Sets, Collections) as keys of a Map. The return values of the methods used to look them up again (hashCode + equals for (Linked)HashMap, compareTo / Comparator.compare for TreeMap) are very likely to change, therefore making it impossible to use methods like get, containsKey and other similar methods. It even allows you to use the very same object as two different keys. For instance: