Number of distinct keys.
Total occurrences (sumCounts).
Add n occurrences of key.
True if the multiset changed.
Creates an independent copy of this multiset.
Returns the count of occurrences for the given key.
Delete n occurrences of key (default 1).
True if any occurrence was removed.
Delete all occurrences of the given key.
True if any occurrence was removed.
Creates a new TreeMultiSet with entries that match the predicate.
Whether the multiset contains the given key.
Maps keys and counts to a new TreeMultiSet. When multiple keys map to the same new key, counts are merged (added).
Set count for key to exactly n.
True if changed.
Creates a new TreeMultiSet.