add method
Implementation
UndoHeader<E> add(E entry, int i) {
// We are at the tip of the tree, so we just append it
if (next == null) {
return append(entry, i);
}
// We need to add an new alt branch to the next element.
return next!.appendAlt(entry, i);
}