Chunk revised = new Chunk(janchor, j - janchor, copyOfRange(rev, janchor, j));
Delta delta = null;
if (original.getSize() == 0 && revised.getSize() != 0) {
delta = new InsertDelta(original, revised);
} else if (original.getSize() > 0 && revised.getSize() == 0) {
delta = new DeleteDelta(original, revised);
} else {
delta = new ChangeDelta(original, revised);
}
patch.addDelta(delta);