@Override
  public void undo(final long mark) {
    int pos = undoLog.size() - 1;
    while (pos >= 0 && undoLog.get(pos).level > mark) {
      final var entry = undoLog.get(pos);
      if (entry.add) {
        delegate.remove(entry.value());
      } else {
        delegate.add(entry.value());
      }
      undoLog.remove(pos);
      pos--;
    }
  }
Create an UndoSet backed by another Set instance.

@param delegate The Set instance to use for backing storage
@param <V> The type of the collection.
@return an unduable set
evm/src/main/java/org/hyperledger/besu/collections/undo/UndoSet.java