func NewReferenceIterator(results []*url.URL, totalItems int) *ReferenceIterator {
	return &ReferenceIterator{
		iterator: newIterator(totalItems),
		results:  results,
	}
}
NewReferenceIterator creates a new ReferenceIterator.
package memstore
import (
	"net/url"
	"github.com/trustbloc/orb/pkg/activitypub/store/spi"
	"github.com/trustbloc/orb/pkg/activitypub/vocab"
)
type iterator struct {
	current    int
	totalItems int
}
func newIterator(totalItems int) *iterator {
	return &iterator{
		totalItems: totalItems,
		current:    -1,
	}
}
func (it *iterator) TotalItems() (int, error) {
	return it.totalItems, nil
}
func (it *iterator) Close() error {
	return nil
}
type ActivityIterator struct {
	*iterator
	results []*vocab.ActivityType
}
func NewActivityIterator(results []*vocab.ActivityType, totalItems int) *ActivityIterator {
	return &ActivityIterator{
		iterator: newIterator(totalItems),
		results:  results,
	}
}
func (it *ActivityIterator) Next() (*vocab.ActivityType, error) {
	if it.current >= len(it.results)-1 {
		return nil, spi.ErrNotFound
	}
	it.current++
	return it.results[it.current], nil
}
type ReferenceIterator struct {
	*iterator
	results []*url.URL
}