@NotNull ImmutableActionChangeRange removeLastFromStack(@NotNull DocumentReference reference) {
    UndoRedoList<ImmutableActionChangeRange> stack = getStack(reference);
    if (stack.isEmpty()) {
      throw new IllegalStateException("Cannot pop from empty stack");
    }
    ImmutableActionChangeRange last = stack.removeLast();
    trimInvalid(stack);
    return last;
  }
@NotNull ImmutableActionChangeRange removeLastFromStack(@NotNull DocumentReference reference)