Session consumerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = consumerSession.createConsumer(destination);
Session publisherSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = publisherSession.createProducer(destination);
HashMap<String, Integer> map = new HashMap<String, Integer>();
ObjectMessage message = publisherSession.createObjectMessage();
for (int i = 0; i < COUNT; i++) {
map.put(VALUE_NAME, Integer.valueOf(i));
message.setObject(map);
producer.send(message);
assertTrue(message.getObject() == map);