def assign_group_items(name, items, raise_if_exists=false)
      group = group_items(name)

      if items.kind_of?(Array)
        items = Set[*items]
      elsif !items.kind_of?(Set)
        items = Set[items]
      end

      c_allocated = allocated.count
      c_group = group.count

      items.each do |item|
        utf8_item = item.encode("UTF-8")
        allocated.add(utf8_item)
        group.add(utf8_item)
      end

      if raise_if_exists
        raise unless group.count == c_group + items.count && allocated.count == c_allocated + items.count
      end

      replace_group(name, group)

      return items
    end
def assign_group_items(name, items, raise_if_exists=false)
      group = group_items(name)

      if items.kind_of?(Array)
        items = Set[*items]
      elsif !items.kind_of?(Set)
        items = Set[items]
      end

      c_allocated = allocated.count
      c_group = group.count

      items.each do |item|
        utf8_item = item.encode("UTF-8")
        allocated.add(utf8_item)
        group.add(utf8_item)
      end

      if raise_if_exists
        raise unless group.count == c_group + items.count && allocated.count == c_allocated + items.count
      end

      replace_group(name, group)

      return items
    end
Assign one or more items to a group. This method is additive, so multitemle
 calls will grow the group, not replace it.