protected void undo() throws CannotUndoException {
        if (insertionPoint <= 0) {
            throw new CannotUndoException();
        }
        while ((insertionPoint > 0) && (!edits.get(insertionPoint - 1).isSignificant())) {
            AbstractEdit edit = edits.get(insertionPoint - 1);
            edit.undo();
            publishEdit(edit);
            insertionPoint = insertionPoint - 1;
        }
        if (insertionPoint > 0) {
            AbstractEdit edit = edits.get(insertionPoint - 1);
            edit.undo();
            publishEdit(edit);
            insertionPoint = insertionPoint - 1;
        }
    }