func (i *addressIterator) Next(addr swarm.Address) error {
	i.mu.Lock()
	defer i.mu.Unlock()
	i.cnt++
	if !i.ignoreDuplicates && i.seen[addr.String()] {
		return fmt.Errorf("duplicit address: %q", addr.String())
	}
	i.seen[addr.String()] = true
	return nil
}
Next matches the signature of swarm.AddressIterFunc needed in
Traverser.Traverse method and collects statistics about it's execution.
package traversal_test
import (
	"bytes"
	"context"
	"fmt"
	"math"
	"path"
	"sync"
	"testing"
	"time"
	"github.com/ethsana/sana/pkg/file/loadsave"
	"github.com/ethsana/sana/pkg/file/pipeline/builder"
	"github.com/ethsana/sana/pkg/manifest"
	"github.com/ethsana/sana/pkg/storage"
	"github.com/ethsana/sana/pkg/storage/mock"
	"github.com/ethsana/sana/pkg/swarm"
	"github.com/ethsana/sana/pkg/traversal"
)
const (
	dataCorpus       = "hello test world"  
	defaultMediaType = "sana-manifest-mantaray"
)
func generateSample(size int) []byte {
	buf := make([]byte, size)
	for n := 0; n < size; {
		n += copy(buf[n:], dataCorpus)
	}
	return buf
}
func newAddressIterator(ignoreDuplicates bool) *addressIterator {
	return &addressIterator{
		seen:             make(map[string]bool),
		ignoreDuplicates: ignoreDuplicates,
	}
}
type addressIterator struct {
	mu   sync.Mutex  
	cnt  int
	seen map[string]bool
	ignoreDuplicates bool
}