None of the IntBackedRefCollections implement equals() and hashCode() as would be correct for java.util Collections. (See for example https://docs.oracle.com/javase/8/docs/api/java/util/Set.html#equals-java.lang.Object-)
Doing this right is difficult and requires that we define some conventions.
It could be relatively easy if we define that for PoolObjects equality always means "the same object in the same pool", that is, we make PoolObject.equals() and PoolObject.hashCode() final.
This came up, because this not-so-nice workaround is required to compare a two Set<Set<T>> for equality, which should in principle just be Set.equals().
None of the IntBackedRefCollections implement
equals()andhashCode()as would be correct forjava.utilCollections. (See for example https://docs.oracle.com/javase/8/docs/api/java/util/Set.html#equals-java.lang.Object-)Doing this right is difficult and requires that we define some conventions.
It could be relatively easy if we define that for
PoolObjects equality always means "the same object in the same pool", that is, we makePoolObject.equals()andPoolObject.hashCode()final.This came up, because this not-so-nice workaround is required to compare a two
Set<Set<T>>for equality, which should in principle just beSet.equals().