Sortable Java collection without duplicates
collections, duplicates, java, sorting
Solution
Use a Set! The common implementations are HashSet and TreeSet. The latter preserves the order of items as it implements SortedSet.
Problem
I am searching for sortable (I mean sorting after initialization and many times using Comparator) Java class collection without duplicates. Is there any more pure solution than writing code which will opaque and prevent for example some ArrayList for adding another object with the same value that already exists? Edit 1: I should add some explanation about sorting. I need to sort this set of values many times with different comparators (diversity of implementations).