# File lib/diff/lcs.rb, line 1073
    def __normalize_patchset(patchset)
      patchset.map do |hunk|
        case hunk
        when Diff::LCS::ContextChange, Diff::LCS::Change
          hunk
        when Array
          if (not hunk[0].kind_of?(Array)) and hunk[1].kind_of?(Array) and hunk[2].kind_of?(Array)
            Diff::LCS::ContextChange.from_a(hunk)
          else
            hunk.map do |change|
              case change
              when Diff::LCS::ContextChange, Diff::LCS::Change
                change
              when Array
                  # change[1] will ONLY be an array in a ContextChange#to_a call.
                  # In Change#to_a, it represents the line (singular).
                if change[1].kind_of?(Array)
                  Diff::LCS::ContextChange.from_a(change)
                else
                  Diff::LCS::Change.from_a(change)
                end
              end
            end
          end
        else
          raise ArgumentError, "Cannot normalise a hunk of class #{hunk.class}."
        end
      end.flatten
    end