// Check that the offline messages are received
for (int i = count; i < 2 * count; ++i)
Assert.assertEquals("hello_" + i, messages.poll(5, TimeUnit.SECONDS).getData());
// Send messages while client is online
client.batch(new Runnable()
{
public void run()
{
for (int i = 2 * count; i < 3 * count; ++i)
client.getChannel(channelName).publish("hello_" + i);