# File multiset.rb, line 632
  def classify_with
    ret = Hash.new{ |hash, key| hash[key] = Multiset.new }
    self.each_pair do |item, count|
      ret[yield(item, count)].add(item, count)
    end
    ret
  end