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: iter_test.go
    path of file: ./repos/cosmos-sdk/collections
    
    the code of the file until where you have to start completion: package collections

import (
	"fmt"
	"testing"

	"github.com/stretchr/testify/require"
)

func TestIteratorBasic(t *testing.T) {
	sk, ctx := deps()
	// safety check to ensure that iteration does not cross prefix boundaries
	err := sk.OpenKVStore(ctx).Set([]byte{0, 0}, []byte("before prefix"))
	require.NoError(t, err)
	err = sk.OpenKVStore(ctx).Set([]byte{2, 1}, []byte("after prefix"))
	require.NoError(t, err)
	schemaBuilder := NewSchemaBuilder(sk)
	m := NewMap(schemaBuilder, NewPrefix(1), "m", StringKey, Uint64Value)
	_, err = schemaBuilder.Build()
	require.NoError(t, err)

	for i := uint64(1); i <= 2; i++ {
		require.NoError(t, m.Set(ctx, fmt.Sprintf("%d", i), i))
	}

	iter, err := m.Iterate(ctx, nil)
	require.NoError(t, err)
	defer iter.Close()

	// key codec
	key, err := iter.Key()
	require.N
    
func TestIteratorRanging(t *testing.T) {
	sk, ctx := deps()
	schemaBuilder := NewSchemaBuilder(sk)
	m := NewMap(schemaBuilder, NewPrefix("cool"), "cool", Uint64Key, Uint64Value)
	_, err := schemaBuilder.Build()
	require.NoError(t, err)

	for i := uint64(0); i <= 7; i++ {
		require.NoError(t, m.Set(ctx, i, i))
	}

	// let's range (1-5]; expected: 2..5
	iter, err := m.Iterate(ctx, (&Range[uint64]{}).StartExclusive(1).EndInclusive(5))
	require.NoError(t, err)
	result, err := iter.Keys()
	require.NoError(t, err)
	require.Equal(t, []uint64{2, 3, 4, 5}, result)

	// let's range [1-5); expected 1..4
	iter, err = m.Iterate(ctx, (&Range[uint64]{}).StartInclusive(1).EndExclusive(5))
	require.NoError(t, err)
	result, err = iter.Keys()
	require.NoError(t, err)
	require.Equal(t, []uint64{1, 2, 3, 4}, result)

	// let's range [1-5) descending; expected 4..1
	iter, err = m.Iterate(ctx, (&Range[uint64]{}).StartInclusive(1).EndExclusive(5).Descending())
	require.NoError(t, err)
	result, err = iter.Keys()
	require.NoError(t, err)
	require.Equal(t, []uint64{4, 3, 2, 1}, result)

	// test iterator invalid
	_, err = m.Iterate(ctx, new(Range[uint64]).StartInclusive(10).EndInclusive(1))
	require.ErrorIs(t, err, ErrInvalidIterator)
}