    # File lib/facets/core/range/combine.rb, line 7
      def self.combine(*intervals)
        intype = intervals.first.class
        result = []

        intervals = intervals.collect do |i|
          [i.first, i.last]
        end

        intervals.sort.inject([]) do |result, (from, to)|
          if result.empty? or from > result.last[1]
            result << [from, to]
          elsif to > result.last[1]
            result.last[1] = to
          end
          result
        end

        if intype <= Range
          result.collect{ |i| ((i.first)..(i.last)) }
        else
          result
        end
      end