private void addOrUpdate(LinkedList<EditOperation> ops, EditOperation.Kind kind, int length) {
    if (length == 0) return;

    if (!ops.isEmpty() && ops.getFirst().getKind() == kind)
      ops.getFirst().incLength(length);
    else
      ops.addFirst(new EditOperation(kind, length));
  }
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