assertEquals(1, publishedMessages.size());
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
final XStream xStream = new XStream();
xStream.toXML(publishedMessages.get(0), baos);
EventMessage actual = (EventMessage) xStream.fromXML(new ByteArrayInputStream(baos.toByteArray()));
assertNotSame(actual.getClass(), publishedMessages.get(0).getClass());
assertEquals(actual.getIdentifier(), publishedMessages.get(0).getIdentifier());
assertEquals(actual.getTimestamp(), publishedMessages.get(0).getTimestamp());
assertEquals(actual.getPayload(), publishedMessages.get(0).getPayload());
assertEquals(actual.getPayloadType(), publishedMessages.get(0).getPayloadType());
assertEquals(actual.getMetaData(), publishedMessages.get(0).getMetaData());
assertEquals("test1", actual.getMetaData().get("test1"));
assertEquals("test2", actual.getMetaData().get("test2"));
assertEquals("test3", actual.getMetaData().get("test3"));
}