# File lib/parallel_tests/grouper.rb, line 15
    def self.in_even_groups_by_size(items_with_sizes, num_groups, options={})
      groups = Array.new(num_groups){{:items => [], :size => 0}}

      # add all files that should run in a single process to one group
      (options[:single_process]||[]).each do |pattern|
        matched, items_with_sizes = items_with_sizes.partition{|item, size| item =~ pattern }
        smallest = smallest_group(groups)
        matched.each{|item,size| add_to_group(smallest, item, size) }
      end

      # add all other files
      smallest_first(items_with_sizes).each do |item, size|
        smallest = smallest_group(groups)
        add_to_group(smallest, item, size)
      end

      groups.map!{|g| g[:items].sort }
    end