@Test
	public void testReceiveMultiple() {
		int noOfMessages = 5;
		try {
			consumer = new AbstractMessageConsumer(mockTopic) {
			};
			assertNotNull(mockTopic.getTopicSubscriber());
			HashSet<Message> messages = new HashSet<Message>();

			for (int i = 0; i < noOfMessages; i++) {
				Message msg = new MockMessage("TestMessage" + i);
				messages.add(msg);
				mockTopic.getTopicSubscriber().onMessage(msg);
			}
			for (int i = 0; i < noOfMessages; i++) {
				FutureTask<Message> future = getMessageFuture(consumer);
				Message received = future.get(100, TimeUnit.MILLISECONDS);
				assertNotNull("Received message is null ", received);
				assertTrue("Unexpected message found",
						messages.remove(received));
			}
		} catch (TimeoutException e) {
			fail("Did not receive message in time");
		} catch (Exception e) {
			logger.error("Error while calling receiving message", e);
			fail("Error while calling onMessage:" + e.getMessage());
		}
	}