void () { setContent(f, "FILE1", TIMESTAMP_INCREMENT); Clock.setTime(TIMESTAMP_INCREMENT * 2); LocalHistoryAction a = LocalHistory.getInstance().startAction(null); setDocumentTextFor(f, "DOC1"); a.finish(); Clock.setTime(TIMESTAMP_INCREMENT * 3); a = LocalHistory.getInstance().startAction(null); setDocumentTextFor(f, "DOC2"); a.finish(); FileDocumentManager.getInstance().saveAllDocuments(); setContent(f, "FILE2", TIMESTAMP_INCREMENT * 4); assertContentAt(new FileRevisionTimestampComparator() { @Override public boolean isSuitable(long revisionTimestamp) { return revisionTimestamp == TIMESTAMP_INCREMENT * 4; } }, "FILE2"); assertContentAt(new FileRevisionTimestampComparator() { @Override public boolean isSuitable(long revisionTimestamp) { return revisionTimestamp == TIMESTAMP_INCREMENT * 3; } }, "DOC2"); assertContentAt(new FileRevisionTimestampComparator() { @Override public boolean isSuitable(long revisionTimestamp) { return revisionTimestamp == TIMESTAMP_INCREMENT * 2; } }, "DOC1"); assertContentAt(new FileRevisionTimestampComparator() { @Override public boolean isSuitable(long revisionTimestamp) { return revisionTimestamp == TIMESTAMP_INCREMENT; } }, "FILE1"); }