Message msg;
// Get first historic message
msg = muc2.nextMessage(1000);
assertNotNull("First message is null", msg);
DelayInformation delay = (DelayInformation) msg.getExtension("x", "jabber:x:delay");
assertNotNull("Message contains no delay information", delay);
SimpleDateFormat UTC_FORMAT = new SimpleDateFormat("yyyyMMdd'T'HH:mm:ss");
UTC_FORMAT.setTimeZone(TimeZone.getDefault());
System.out.println(UTC_FORMAT.format(delay.getStamp()));
assertEquals("Body of first message is incorrect", "Message 3", msg.getBody());
// Try to get second historic message
msg = muc2.nextMessage(1000);
assertNull("Second message is not null", msg);