final CountDownLatch latch = new CountDownLatch(numSubtasks);
// --------------------------------------------------------------------
// setup
// --------------------------------------------------------------------
ChannelManager channelManager = mock(ChannelManager.class);
doAnswer(new VerifyEnvelopes(latch, numToSendPerSubtask))
.when(channelManager).dispatchFromNetwork(Matchers.<Envelope>anyObject());
final NettyConnectionManager senderConnManager = new NettyConnectionManager(localhost, BIND_PORT, BUFFER_SIZE,
numInThreads, numOutThreads, -1, -1);