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