You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: paych_test.go
    path of file: ./repos/lotus/paychmgr
    
    the code of the file until where you have to start completion: // stm: #unit
package paychmgr

import (
	"bytes"
	"context"
	"testing"

	"github.com/ipfs/go-cid"
	ds "github.com/ipfs/go-datastore"
	ds_sync "github.com/ipfs/go-datastore/sync"
	"github.com/stretchr/testify/require"

	"github.com/filecoin-project/go-address"
	"github.com/filecoin-project/go-state-types/abi"
	"github.com/filecoin-project/go-state-types/big"
	paychtypes "github.com/filecoin-project/go-state-types/builtin/v8/paych"
	"github.com/filecoin-project/go-state-types/crypto"
	"github.com/filecoin-project/specs-actors/v2/actors/builtin"
	tutils "github.com/filecoin-project/specs-actors/v2/support/testing"

	"github.com/filecoin-project/lotus/api"
	"github.com/filecoin-project/lotus/chain/actors/builtin/paych"
	paychmock "github.com/filecoin-project/lotus/chain/actors/builtin/paych/mock"
	"github.com/filecoin-project/lotus/chain/types"
	"github.com/filecoin-project/lotus/lib/sigs"
	_ "github.com/filecoin-project/lotus/lib/sigs/s
    
func TestAllocateLaneWithExistingLaneState(t *testing.T) {
	ctx := context.Background()

	fromKeyPrivate, fromKeyPublic := testGenerateKeyPair(t)

	ch := tutils.NewIDAddr(t, 100)
	from := tutils.NewSECP256K1Addr(t, string(fromKeyPublic))
	to := tutils.NewSECP256K1Addr(t, "secpTo")
	fromAcct := tutils.NewActorAddr(t, "fromAct")
	toAcct := tutils.NewActorAddr(t, "toAct")

	mock := newMockManagerAPI()
	mock.setAccountAddress(fromAcct, from)
	mock.setAccountAddress(toAcct, to)
	mock.addWalletAddress(to)

	store := NewStore(ds_sync.MutexWrap(ds.NewMapDatastore()))

	// Create a channel that will be retrieved from state
	actorBalance := big.NewInt(10)

	act := &types.Actor{
		Code:    builtin.AccountActorCodeID,
		Head:    cid.Cid{},
		Nonce:   0,
		Balance: actorBalance,
	}

	mock.setPaychState(ch, act, paychmock.NewMockPayChState(fromAcct, toAcct, abi.ChainEpoch(0), make(map[uint64]paych.LaneState)))

	mgr, err := newManager(store, mock)
	require.NoError(t, err)

	// Create a voucher on lane 2
	// (also reads the channel from state and puts it in the store)
	voucherLane := uint64(2)
	minDelta := big.NewInt(0)
	nonce := uint64(2)
	voucherAmount := big.NewInt(5)
	sv := createTestVoucher(t, ch, voucherLane, nonce, voucherAmount, fromKeyPrivate)
	_, err = mgr.AddVoucherInbound(ctx, ch, sv, nil, minDelta)
	require.NoError(t, err)

	//stm: @TOKEN_PAYCH_ALLOCATE_LANE_001
	// Allocate lane should return the next lane (lane 3)
	lane, err := mgr.AllocateLane(ctx, ch)
	require.NoError(t, err)
	require.EqualValues(t, 3, lane)
}