"Attempts to modify the returned sorted map. ..."
It will only throw an UnsupportedOperationException
on the Map
returned from the unmodifiableMap(...)
call, which does not include the original Map
.
The Map
that gets returned from unmodifiableMap(...)
is not the same as the original Map
.