I am looking for a Set class that will use this comparator for removeAll ().
I used TreeSet, but after a few hours tore my hair, trying to understand why my removeAll () does not remove everything I found ...
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4730113
In short, removeAll () uses the equals () method. (But, oddly enough, the remove () method is not ...)
I need a set in which duplicates are removed, preferably using a comparator, but not required, and I cannot override the equals b / c method. I need this, as for other logic. And, obviously, I would like to avoid creating a loop that calls remove () for all elements so that it doesn't confuse me in the future (or anyone else).
Does such an animal exist?
source
share