public static void Do <T>(this UndoRedoState <T> undoRedoState, IEnumerable <T> items)
    {
        ArgumentNullException.ThrowIfNull(undoRedoState);
        ArgumentNullException.ThrowIfNull(items);

        var unprocessedItemCount = undoRedoState.GetUnprocessedItemCount();

        if (unprocessedItemCount > 0)
        {
            undoRedoState.Items.RemoveRange(undoRedoState.ProcessedItemCount, unprocessedItemCount);
        }

        var itemList = items.ToList();

        undoRedoState.Items.AddRange(itemList);
        undoRedoState.ProcessedItemCount += itemList.Count;
    }
    public static void Redo <T>(this UndoRedoState <T> undoRedoState, int itemCount, Action <IReadOnlyList <T> > process)
    {
        ArgumentNullException.ThrowIfNull(undoRedoState);
        Assert.IsInRange(itemCount > 0);
        ArgumentNullException.ThrowIfNull(process);

        var unprocessedItemCount = undoRedoState.GetUnprocessedItemCount();

        if (unprocessedItemCount < itemCount)
        {
            throw new InvalidOperationException("Nincs meg a megadott számú ismételhető művelet.");
        }

        var items = undoRedoState.Items.GetRange(undoRedoState.ProcessedItemCount, itemCount).ToList();

        process(items);
        undoRedoState.ProcessedItemCount += itemCount;
    }