I need a Collection
that sorts the element, but does not removes the duplicates.
I have gone for a TreeSet
, since TreeSet
actu
You can use a PriorityQueue.
PriorityQueue pQueue = new PriorityQueue();
PriorityQueue()
: Creates a PriorityQueue with the default initial capacity (11) that orders its elements according to their natural ordering.
This is a link to doc: https://docs.oracle.com/javase/8/docs/api/java/util/PriorityQueue.html