@Test
	public void testReceiveMultipleManyToBeExpiredSomeValid() {
		int noOfMessages = 13;
		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(
						"testReceiveMultipleManyToBeExpiredSomeValid" + i);

				// Insert only two messages, first two
				if (i % 2 == 0)
					messages.add(msg);
				else
					msg.setExpiration(System.currentTimeMillis() + 6);
				mockTopic.getTopicSubscriber().onMessage(msg);
			}
			Thread.sleep(7);
			for (int i = 0; i < messages.size(); i++) {
				FutureTask<Message> future = getMessageFuture(consumer);
				Message received = future.get(6, TimeUnit.MILLISECONDS);
				assertNotNull("Received message is null ", received);
				assertTrue("Unexpected message found:" + received,
						messages.remove(received));
			}
		} catch (TimeoutException e) {
			fail("Timeout did not happen on receive method");
		} catch (Exception e) {
			logger.error("Error while calling receiving message", e);
			fail("Error while calling onMessage:" + e.getMessage());
		}
	}