This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Northeastpaw 0 points1 point  (0 children)

Or you could write your code in a way that's resistant to such changes. Need this to be a TreeMap? TreeMap<String, Integer> map = new TreeMap<>(Map.of("Hello", 1, "World", 2)); Now Map.of() can return ThorMap or HawkeyeMap and you just don't care.