Eclipse Collections ( GS Collections) Bag ( Multiset), toMapOfItemToCount().
HashBag<Integer> bag = HashBag.newBagWith(1, 2, 2, 3, 3, 3);
Map<Integer,Integer> map = bag.toMapOfItemToCount();
Assert.assertEquals(UnifiedMap.newWithKeysValues(1, 1, 2, 2, 3, 3), map);
UnifiedMap HashMap.
: Eclipse.