func (l *ListenerMock) Accept() (net.Conn, error) {
	args := l.Called()
	if numberOfMockMethodCalls(l.Mock, "Accept") > 1 {
		select {}
	}
	if args.Get(0) == nil {
		return nil, args.Error(1)
	}
	return args.Get(0).(net.Conn), args.Error(1)
}
Accept mocks the method of the same name on the net.Listener interface.
It is a special mock method that normally blocks forever. When expected
return values are set it will return those for the first call.
package mock
import (
	"net"
	"github.com/stretchr/testify/mock"
)
type ListenerMock struct {
	net.Listener
	mock.Mock
}
func numberOfMockMethodCalls(mock mock.Mock, method string) int {
	count := 0
	for _, call := range mock.Calls {
		if call.Method == method {
			count++
		}
	}
	return count
}