Battle Hymn of the Republic
the greatest trick that Java ever played was to convince programmers everywhere that "an interface for an arbitrary map implementation" is even vaguely expressible/usable by anything but the most advanced type systems
@zkat @yosh@toot.yosh.is trying to do generic collection interfaces is riddled with weird design landmines like this. so many things have Basically The Same Shape but differ in One Weird Way that makes shoving them into one box really weird To the extent that Java does it, they do a lot of weird cheats. Like equals and hashCode are defined on *Object* so that the Map interface doesn't need to specify requirements on the key type. "but wait, what about ordered maps" well of course those just dynamically cast their Object keys to Comparable and crash at runtime if it fails https://github.com/openjdk-mirror/jdk7u-jdk/blob/f4d80957e89a19a29bb9f9807d2a28351ed7f7df/src/share/classes/java/util/TreeMap.java#L343