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<E, Integer> where Integer is the count is a good replacement for Multiset, and it does not need any third party library as well.
Map<E, Integer>
Update: If you really want to store the object twice, use a List with a Map like Map<E, List<E>>.
Map<E, List<E>>