m = consumer.receive(500);
m = consumer.receiveNoWait();
	public void testLazyAcknowledge() throws Exception   {		Connection conn = cf.createConnection();		Session producerSess = conn.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);		MessageProducer producer = producerSess.createProducer(queue);		Session consumerSess = conn.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);		MessageConsumer consumer = consumerSess.createConsumer(queue);		conn.start();		final int NUM_MESSAGES = 20;		//Send some messages		for (int i = 0; i < NUM_MESSAGES; i++)		{			Message m = producerSess.createMessage();			producer.send(m);		}		log.trace("Sent messages");		int count = 0;		Message m = null;		for (int i = 0; i < NUM_MESSAGES; i++)		{			m = consumer.receive(500);			if (m == null) break;			count++;		}		assertNotNull(m);		log.trace("Received " + count +  " messages");		assertEquals(count, NUM_MESSAGES);		consumerSess.recover();		log.trace("Session recover called");		m = consumer.receive(2000);		log.trace("Message is:" + m);		assertNull(m);		conn.close();   }