@Test
	public void testPutGetMessagesInOrder() {
		try {
			int noOfMessages = 5;
			final CountDownLatch gate = new CountDownLatch(noOfMessages);
			final ArrayList<Message> list = new ArrayList<Message>(noOfMessages);
			for (int i = 0; i < noOfMessages; i++) {
				Message msg = new MockMessage("TestMessage");
				list.add(i, msg);
			}
			AsyncMessageConsumer testSubscriber = new MockTopicSubscriber() {
				int cnt = 0;

				public void onMessage(Message received) {

					assertNotNull("Received Null Message", received);
					assertEquals("Message values are not equal", list.get(cnt),
							received);
					cnt++;
					gate.countDown();

				}
			};
			destination.addSubscriber(testSubscriber);
			for (Message message : list) {
				destination.put(message);
			}
			boolean messageReceived = gate.await(100, TimeUnit.MILLISECONDS);
			assertTrue("Did not receive message in 100ms", messageReceived);
		} catch (Throwable e) {
			fail("Error while putting message in topic" + e.getMessage());
		}

	}