pm.addReferences(channel.getChannelID(), refs, false);
pm.pageReferences(channel.getChannelID(), refs, false);
   public void testPageOrders() throws Throwable   {      doSetup(false, 100);            Channel channel = new SimpleChannel(0, ms);            Message[] m = createMessages(10);            List refs = new ArrayList();            MessageReference ref1 = ms.reference(m[0]);      MessageReference ref2 = ms.reference(m[1]);      MessageReference ref3 = ms.reference(m[2]);      MessageReference ref4 = ms.reference(m[3]);      MessageReference ref5 = ms.reference(m[4]);      MessageReference ref6 = ms.reference(m[5]);      MessageReference ref7 = ms.reference(m[6]);      MessageReference ref8 = ms.reference(m[7]);      MessageReference ref9 = ms.reference(m[8]);      MessageReference ref10 = ms.reference(m[9]);            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);             ref1.setPagingOrder(0);      ref2.setPagingOrder(1);      ref3.setPagingOrder(2);      ref4.setPagingOrder(3);      ref5.setPagingOrder(4);      ref6.setPagingOrder(5);      ref7.setPagingOrder(6);      ref8.setPagingOrder(7);      ref9.setPagingOrder(8);      ref10.setPagingOrder(9);            pm.updatePageOrder(channel.getChannelID(), refs);            List refInfos = pm.getPagedReferenceInfos(channel.getChannelID(), 0, 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.getPagedReferenceInfos(channel.getChannelID(), 3, 5);            assertNotNull(refInfos);            assertEquals(5, refInfos.size());            assertEquals(ref4.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(0)).getMessageId());      assertEquals(ref5.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(1)).getMessageId());      assertEquals(ref6.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(2)).getMessageId());      assertEquals(ref7.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(3)).getMessageId());      assertEquals(ref8.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(4)).getMessageId());          pm.updateReliableReferencesNotPagedInRange(channel.getChannelID(), 0, 3, 4);            refInfos = pm.getPagedReferenceInfos(channel.getChannelID(), 5, 5);            assertNotNull(refInfos);            assertEquals(5, refInfos.size());                assertEquals(ref6.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(0)).getMessageId());      assertEquals(ref7.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(1)).getMessageId());      assertEquals(ref8.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(2)).getMessageId());      assertEquals(ref9.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(3)).getMessageId());      assertEquals(ref10.getMessageID(), ((PersistenceManager.ReferenceInfo)refInfos.get(4)).getMessageId());                   }