I would think the best solution for that would be to have a separate interface for methods (toArray/contains/remove) that don't apply to all collections (or perhaps I should call them data structures?). The fact that the Map and Collection interfaces have so many methods in common seems like a clear indicator that they should have a common ancestor.
You know, you're absolutely right: that would have been another, perfectly valid way to set the language up. Another way to handle the issue - at least, most of the issues - would have been through method overloading, where you could, say, feed the method that would have to behave differently your Map object as a parameter. This has its own set of problems, but I digress.
The point is that there are several ways they could have handled the issue, and they probably chose the option they did to minimize the work on their end. Providing a separate interface for each of your collections - which would require you to write many identical methods, if I'm going through this correctly in my head - when all of your collections EXCEPT Map behave the same in the context of those methods is inefficient. Why not instead compartmentalize Map as its own class since it's the only collection that behaves radically differently from the others, then justify it with some mumbo-jumbo about how Maps aren't really a collection?
I know that if I had just spent hours trying to put together a Collection class and there's this ONE COLLECTION that isn't behaving properly because it needs some SPECIAL METHODS and I can't figure out how its DUMB, STUPID SELF is supposed to play nice with some of the methods that all of my other collections have in common I would be liable to say "*** it, I'm making a separate class, John over in HR can deal with it."
Of course that's mildly facetious, but you have to poke fun at Java every once in a while to stay sane
Really, I'm just bitter because I thought I could rely on (myVar instanceof Collection) returning true if myVar is a map.
Oooooh, yeah, that is not fun. At least you've got it now though, and congrats for figuring out on your own what the problem was! You're a more patient man than I!
Mind if I ask what it was for? I'm a bit of a fan of your work, especially the Starship Legends mod. That added some excellent flavor to the ships, and fantastic lasting consequences of performance, IMO.