boolean isTested = false;
DocumentList docList = traverser.getDocumentList(new Checkpoint());
assertNotNull("Document list is null", docList);
Document doc = docList.nextDocument();
while (doc != null && doc instanceof FileDocument) {
Property lastModifiedProp =
doc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED);
Value lastModifiedValue = lastModifiedProp.nextValue();
Calendar cal = Value.iso8601ToCalendar(lastModifiedValue.toString());
Document nextDoc = docList.nextDocument();
if (nextDoc != null && nextDoc instanceof FileDocument) {
Property nextDocLastModifiedProp =
nextDoc.findProperty(SpiConstants.PROPNAME_LASTMODIFIED);
Value nextDocLastModifiedValue = nextDocLastModifiedProp.nextValue();
Calendar nextCal =
Value.iso8601ToCalendar(nextDocLastModifiedValue.toString());
assertTrue(cal.compareTo(nextCal) <= 0);
isTested = true;
}