I need a data structure which works like the STL multiset but the TreeSet in Java doesn\'t allow duplicate elements. Is there any built-in data structure in Java which is eq
Using Map where Integer is the count is a good replacement for Multiset, and it does not need any third party library as well.
Map
Update: If you really want to store the object twice, use a List with a Map like Map>.
Map>