Message m = MessageFactory.createMessage("message0", true, 777l, 888l, 9, headers, "payload");
Message m = MessageFactory.createMessage("message0", true, 777l, 888l, (byte)9, headers, "payload");
   public void testTwoStoresSameDatabase() throws Exception   {      Message m = MessageFactory.createMessage("message0", true, 777l, 888l, 9, headers, "payload");      assertEquals(0, ((JDBCMessageStore)ms).getMessageReferenceCount(m.getMessageID()));      MessageReference ref = ms.reference(m);            log.debug("referenced " + m + " using " + ms);      assertCorrectReference(ref, ms.getStoreID(), m);      assertEquals(1, ((JDBCMessageStore)ms).getMessageReferenceCount(m.getMessageID()));      // add the same message to the second store      MessageReference ref2 = ms2.reference(m);      log.debug("referenced " + m + " using " + ms2);      assertCorrectReference(ref2, ms2.getStoreID(), m);      assertEquals(2, ((JDBCMessageStore)ms2).getMessageReferenceCount(m.getMessageID()));      assertFalse(ref == ref2);      ref.release();      assertEquals(1, ((JDBCMessageStore)ms2).getMessageReferenceCount(m.getMessageID()));      // ... but because the message is still in the database, trying to get a new reference      // is successful.      ref = ms.reference((String)m.getMessageID());      assertCorrectReference(ref, ms.getStoreID(), m);            assertEquals(2, ((JDBCMessageStore)ms2).getMessageReferenceCount(m.getMessageID()));      ref.release();      ref2.release();            assertNull(ms.reference((String)m.getMessageID()));      assertNull(ms2.reference((String)m.getMessageID()));      assertEquals(0, ((JDBCMessageStore)ms2).getMessageReferenceCount(m.getMessageID()));   }