log.trace("Got message: " + tm.getText());
      public void onMessage(Message m)      {         try         {            count++;                              TextMessage tm = (TextMessage)m;                                  // Receive first three messages then recover() session            // Only last message should be redelivered            if (count == 1)            {               assertRemainingMessages(3);                              if (!"a".equals(tm.getText()))               {                  failed = true;                  latch.release();               }            }            if (count == 2)            {               assertRemainingMessages(2);                              if (!"b".equals(tm.getText()))               {                  failed = true;                  latch.release();               }            }            if (count == 3)            {               assertRemainingMessages(1);                              if (!"c".equals(tm.getText()))               {                  failed = true;                  latch.release();               }               sess.recover();            }            if (count == 4)            {               assertRemainingMessages(1);                              if (!"c".equals(tm.getText()))               {                  failed = true;                  latch.release();               }                              latch.release();            }                                    }         catch (Exception e)         {            failed = true;            latch.release();         }      }