final String NONRETAINED = "NONRETAINED";
connection.publish("one", NONRETAINED.getBytes(), QoS.AT_LEAST_ONCE, false);
connection.publish("two", NONRETAINED.getBytes(), QoS.AT_LEAST_ONCE, false);
connection.subscribe(new Topic[]{new Topic("#", QoS.AT_LEAST_ONCE)});
for (int i = 0; i < 4; i++) {
final Message message = connection.receive(30, TimeUnit.SECONDS);
assertNotNull("Should receive 4 messages", message);
message.ack();
}