final Date date1 = dateParser.parseDateTime("1977-01-17T01:05:40Z").getTime();
final Date date2 = dateParser.parseDateTime("2011-07-29T23:49:40Z").getTime();
FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
// This is in consistent as the FIRST entry cannot have a previous1
ResourceIdImpl resourceId = new ResourceIdImpl("rid1", "abc", new Version(FIRST));
resourceId.setPreviousRid("previous1");
assertEquals( resourceId.getID(), ids.get(0).getID());
assertEquals(ff.resourceId("rid2", "", new Version(LAST)).getID(),
ids.get(1).getID());
assertEquals(ff.resourceId("rid3", "", new Version(PREVIOUS)).getID(),
ids.get(2).getID());
assertEquals(ff.resourceId("rid4", "", new Version(NEXT)).getID(),
ids.get(3).getID());
assertEquals(ff.resourceId("rid5", "", new Version(ALL)).getID(),
ids.get(4).getID());
// This is inconsistent as date and resource based query cannot be used at the same time
ResourceIdImpl resourceId2 = new ResourceIdImpl("rid6", "", new Version(4));
resourceId2.setPreviousRid("previous2");
resourceId2.setStartTime(date1);
resourceId2.setEndTime(date2);
assertEquals( resourceId2.getID(),
ids.get(5).getID());
assertEquals(ff.resourceId("rid7", "123", new Version(date1)).getID(), ids.get(6).getID());
}