I used TreeSet with a self-recording comparator. Now, when I add elements to the TreeSet and the Comparator comparison methods return 0, it looks like the TreeSet contains only one of the Object with equal rank.
I have not seen this behavior described in javadocs. Maybe I missed something. Can you confirm this behavior?
I edited the comparator. Now it never returns 0, and the TreeSet contains all objects with equal rank.
Is this the way it should be if I want to have multiple objects with equal rank?
c0d3x
source
share