That might be how you think it should work, but that's not how it works in reality: the unmodifiableXYZ() functions give you either a SortedSet (which implements Collection), a SortedMap (which...
Type: Posts; User: KevinWorkman
That might be how you think it should work, but that's not how it works in reality: the unmodifiableXYZ() functions give you either a SortedSet (which implements Collection), a SortedMap (which...
Good point about the views guys, I hadn't really thought it through.
I guess the "answer" is that the UnmodifiableDataStructure has to at least implement the Collection interface to be useful, so...
One benefit of the way Java does it is that it allows you to create unmodifiable views of your data structures, which is the whole point of the methods in the first place. If it returned some other...