Is there a list of requirements somewhere for a "proper" collection implementation? I seem to remember all collections must implement
equals
and
hashCode
in a certain way to ensure they can all be compared with each other, but I don't know where that exactly is specified
f
Filipp Zhinkin
03/19/2025, 8:39 PM
Requirements for Kotlin collection interfaces (Collection, List, Set, Map and their mutable counterparts) are currently on internal review.
Meanwhile, you can check contracts for similar Java collections (like https://docs.oracle.com/javase/8/docs/api/java/util/List.html).