The returned list is unmodifiable because changes to the values of the list (using {@link java.util.ListIterator#set(Object)}) will effectively remove the value from the list and reinsert that value at the end of the list, which is an unexpected side effect of changing the value of a list. This occurs because changing the key, changes when the mapping is added to the map and thus where it appears in the list.
An alternative to this method is to use {@link #keySet()}. @see #keySet() @return The ordered list of keys.
|
|
|
|