Message m3 = (Message)newcons.receive(3000);
Message m3 = (Message)newcons.receiveNoWait();
   public void testPersistentMessagesForTopicDropped2() throws Exception   {      TopicConnection conn = null;            try      {         conn = cf.createTopicConnection();         conn.start();         TopicSession sess = conn.createTopicSession(true, 0);         TopicPublisher pub = sess.createPublisher(topic);         TopicSubscriber sub = sess.createSubscriber(topic);         pub.setDeliveryMode(DeliveryMode.PERSISTENT);                  Message m = sess.createTextMessage("testing123");         pub.publish(m);         sess.commit();                  //receive but rollback         TextMessage m2 = (TextMessage)sub.receive(3000);         assertNotNull(m2);         assertEquals("testing123", m2.getText());                  sess.rollback();                  conn.close();         conn = cf.createTopicConnection();         conn.start();                  TopicSession newsess = conn.createTopicSession(true, 0);         TopicSubscriber newcons = newsess.createSubscriber(topic);                  Message m3 = (Message)newcons.receive(3000);         assertNull(m3);      }      finally      {         if (conn != null)         {            conn.close();         }      }   }