public bool MultiSetEquals(IEnumerable <T> other)
        {
            var multiset = new MultiSet <T>(other);

            foreach (T el in elements.Keys)
            {
                if (!multiset.Contains(el) || multiset[el] != this[el])
                {
                    return(false);
                }
            }
            return(true);
        }
        public MultiSet <T> ExceptWith(IEnumerable <T> other)
        {
            if (other is null)
            {
                throw new ArgumentNullException();
            }
            ThrowExceptionIfReadOnly();
            var multiset   = new MultiSet <T>(other);
            var enumerator = multiset.GetEnumerator();

            while (enumerator.MoveNext())
            {
                Remove(enumerator.Current, multiset[enumerator.Current]);
            }
            return(this);
        }
        public bool IsSupersetOf(IEnumerable <T> other)
        {
            if (other is null)
            {
                throw new ArgumentNullException();
            }
            var multiset   = new MultiSet <T>(other);
            var enumerator = multiset.GetEnumerator();

            while (enumerator.MoveNext())
            {
                if (!Contains(enumerator.Current) || multiset[enumerator.Current] > this[enumerator.Current])
                {
                    return(false);
                }
            }
            return(true);
        }
        public static MultiSet <T> operator +(MultiSet <T> first, MultiSet <T> second)
        {
            if (first is null || second is null)
            {
                throw new ArgumentNullException();
            }
            var multiset         = new MultiSet <T>();
            var firstEnumerator  = first.GetEnumerator();
            var secondEnumerator = second.GetEnumerator();

            while (firstEnumerator.MoveNext())
            {
                multiset.Add(firstEnumerator.Current, first[firstEnumerator.Current]);
            }
            while (secondEnumerator.MoveNext())
            {
                multiset.Add(secondEnumerator.Current, second[secondEnumerator.Current]);
            }
            return(multiset);
        }