assertTrue("server failed to connect.", serverPair.listener.isConnected());
assertTrue("client failed to connect.", clientListener.isConnected());
for (int i = 0; i < numberOfMessagesToSend; ++i) {
serverPair.channel.sendMessage(i, TestMessage.create(i));
client.sendMessage(i, TestMessage.create(i));
}
assertEquals("server received wrong # of messages.",
numberOfMessagesToSend, serverPair.listener.getMessageCount());
assertEquals("client received wrong # of messages.",