refInfos = pm.getReferenceInfos(channel.getChannelID(), 19);
refInfos = pm.getReferenceInfos(channel.getChannelID(), 2, 6);
   public void testGetReferenceInfos() throws Exception   {      doSetup(false);            Channel channel = new SimpleChannel(0, ms);            Message[] m = createMessages(10);            MessageReference ref1 = ms.reference(m[0]);      ref1.setOrdering(0);      MessageReference ref2 = ms.reference(m[1]);      ref2.setOrdering(1);      MessageReference ref3 = ms.reference(m[2]);      ref3.setOrdering(2);      MessageReference ref4 = ms.reference(m[3]);      ref4.setOrdering(11);      MessageReference ref5 = ms.reference(m[4]);      ref5.setOrdering(22);      MessageReference ref6 = ms.reference(m[5]);      ref6.setOrdering(100);      MessageReference ref7 = ms.reference(m[6]);      ref7.setOrdering(303);      MessageReference ref8 = ms.reference(m[7]);      ref8.setOrdering(1000);      MessageReference ref9 = ms.reference(m[8]);      ref9.setOrdering(1001);      MessageReference ref10 = ms.reference(m[9]);      ref10.setOrdering(1002);            List refs = new ArrayList();            refs.add(ref1);      refs.add(ref2);      refs.add(ref3);      refs.add(ref4);      refs.add(ref5);      refs.add(ref6);      refs.add(ref7);      refs.add(ref8);      refs.add(ref9);      refs.add(ref10);            pm.addReferences(channel.getChannelID(), refs, false);            List refIds = getReferenceIds(channel.getChannelID());      assertNotNull(refIds);      assertEquals(10, refIds.size());                 assertTrue(refIds.contains(new Long(ref1.getMessageID())));      assertTrue(refIds.contains(new Long(ref2.getMessageID())));      assertTrue(refIds.contains(new Long(ref3.getMessageID())));      assertTrue(refIds.contains(new Long(ref4.getMessageID())));      assertTrue(refIds.contains(new Long(ref5.getMessageID())));      assertTrue(refIds.contains(new Long(ref6.getMessageID())));      assertTrue(refIds.contains(new Long(ref7.getMessageID())));      assertTrue(refIds.contains(new Long(ref8.getMessageID())));      assertTrue(refIds.contains(new Long(ref9.getMessageID())));      assertTrue(refIds.contains(new Long(ref10.getMessageID())));            List msgs = getMessageIds();      assertNotNull(msgs);      assertEquals(10, msgs.size());      assertTrue(msgs.contains(new Long(ref1.getMessageID())));      assertTrue(msgs.contains(new Long(ref2.getMessageID())));      assertTrue(msgs.contains(new Long(ref3.getMessageID())));      assertTrue(msgs.contains(new Long(ref4.getMessageID())));      assertTrue(msgs.contains(new Long(ref5.getMessageID())));      assertTrue(msgs.contains(new Long(ref6.getMessageID())));      assertTrue(msgs.contains(new Long(ref7.getMessageID())));      assertTrue(msgs.contains(new Long(ref8.getMessageID())));      assertTrue(msgs.contains(new Long(ref9.getMessageID())));      assertTrue(msgs.contains(new Long(ref10.getMessageID())));            List refInfos = pm.getReferenceInfos(channel.getChannelID(), 0);            assertNotNull(refInfos);      assertEquals(0, refInfos.size());            refInfos = pm.getReferenceInfos(channel.getChannelID(), 3);      assertNotNull(refInfos);      assertEquals(3, refInfos.size());      assertEquals(ref1.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(0)).getMessageId());      assertEquals(ref2.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(1)).getMessageId());      assertEquals(ref3.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(2)).getMessageId());            refInfos = pm.getReferenceInfos(channel.getChannelID(), 10);      assertNotNull(refInfos);      assertEquals(10, refInfos.size());      assertEquals(ref1.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(0)).getMessageId());      assertEquals(ref2.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(1)).getMessageId());      assertEquals(ref3.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(2)).getMessageId());      assertEquals(ref4.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(3)).getMessageId());      assertEquals(ref5.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(4)).getMessageId());      assertEquals(ref6.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(5)).getMessageId());      assertEquals(ref7.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(6)).getMessageId());      assertEquals(ref8.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(7)).getMessageId());      assertEquals(ref9.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(8)).getMessageId());      assertEquals(ref10.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(9)).getMessageId());            refInfos = pm.getReferenceInfos(channel.getChannelID(), 19);      assertNotNull(refInfos);      assertEquals(10, refInfos.size());      assertEquals(ref1.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(0)).getMessageId());      assertEquals(ref2.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(1)).getMessageId());      assertEquals(ref3.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(2)).getMessageId());      assertEquals(ref4.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(3)).getMessageId());      assertEquals(ref5.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(4)).getMessageId());      assertEquals(ref6.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(5)).getMessageId());      assertEquals(ref7.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(6)).getMessageId());      assertEquals(ref8.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(7)).getMessageId());      assertEquals(ref9.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(8)).getMessageId());      assertEquals(ref10.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(9)).getMessageId());             pm.removeAllChannelData(channel.getChannelID());        }