func (rpm *MockRingpopMonitor) FindHostForAddr(service string, addr string) (*HostInfo, error) {
	rpm.RLock()
	defer rpm.RUnlock()
	if hosts, ok := rpm.serviceHosts[service]; ok {
		for _, hi := range hosts {
			if hi.Addr == addr {
				return hi, nil
			}
		}
	}
	return &HostInfo{}, ErrInsufficientHosts
}
FindHostForAddr finds and returns the host for the given address
package common
import (
	"math/rand"
	"strings"
	"sync"
)
type MockRingpopMonitor struct {
	sync.RWMutex
	serviceHosts map[string][]*HostInfo
}
func NewMockRingpopMonitor() *MockRingpopMonitor {
	return &MockRingpopMonitor{
		serviceHosts: make(map[string][]*HostInfo),
	}
}
func (rpm *MockRingpopMonitor) Add(service string, uuid string, addr string) {
	rpm.Lock()
	defer rpm.Unlock()
	rpm.serviceHosts[service] = append(rpm.serviceHosts[service], &HostInfo{UUID: uuid, Addr: addr})
}
func (rpm *MockRingpopMonitor) Remove(service string, uuid string) {
	rpm.Lock()
	defer rpm.Unlock()
	curr, ok := rpm.serviceHosts[service]
	if !ok {
		return
	}
	hosts := make([]*HostInfo, 0, len(curr))
	for _, h := range curr {
		if strings.Compare(h.UUID, uuid) == 0 {
			continue
		}
		hosts = append(hosts, h)
	}
	rpm.serviceHosts[service] = hosts
}
func (rpm *MockRingpopMonitor) Start() {}
func (rpm *MockRingpopMonitor) Stop() {}
func (rpm *MockRingpopMonitor) GetBootstrappedChannel() chan struct{} {
	return nil
}
func (rpm *MockRingpopMonitor) GetHosts(service string) ([]*HostInfo, error) {
	rpm.RLock()
	defer rpm.RUnlock()
	return rpm.serviceHosts[service], nil
}