public int diff_levenshtein(LinkedList<Diff> diffs) {
    int levenshtein = 0;
    int insertions = 0;
    int deletions = 0;
    for (Diff aDiff : diffs) {
      switch (aDiff.operation) {
        case INSERT:
          insertions += aDiff.text.length();
          break;
        case DELETE:
          deletions += aDiff.text.length();
          break;
        case EQUAL:
          // A deletion and an insertion is one substitution.
          levenshtein += Math.max(insertions, deletions);
          insertions = 0;
          deletions = 0;
          break;
      }
    }
    levenshtein += Math.max(insertions, deletions);
    return levenshtein;
  }
Compute the Levenshtein distance; the number of inserted, deleted or
substituted characters.

@param diffs LinkedList of Diff objects.
@return Number of changes.
src/burp/Utils/diff_match_patch.java