private void calculateMatrix() {
    for (int i = 0; i < seq1.length() + 1; i++) {
      matrix[i] = new int[seq2.length() + 1];
      for (int j = 0; j < seq2.length() + 1; j++) {
        if (i == 0) matrix[i][j] = j;      // j insertions
        else if (j == 0) matrix[i][j] = i; // i deletions
        else matrix[i][j] = min(
              matrix[i][j - 1] + 1, // insertion
              matrix[i - 1][j] + 1, // deletion
              matrix[i - 1][j - 1] + (seq1.charAt(i - 1) == seq2.charAt(j - 1) ? 0 : 1)); // substitution
      }
    }
  }
Calculates Levenshtein distance and corresponding edit path between two character sequences.
Inspired from: https://etorreborre.blogspot.com/2008/06/edit-distance-in-scala_245.html

Ideas for improvements:
- Favor fewer EditOperationS when calculating distance and/or path
- Use algorithm with lower time and/or space complexity

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/runtime/condition/EditDistance.java