### Question:
FileChangeNumberIndexDB implements ChangeNumberIndexDB { public void clear() throws ChangelogException { log.clear(); newestChangeNumber = NO_KEY; } FileChangeNumberIndexDB(FileChangelogDB changelogDB, ReplicationEnvironment replicationEnv); @Override long addRecord(final ChangeNumberIndexRecord record); @Override ChangeNumberIndexRecord getOldestRecord(); @Override ChangeNumberIndexRecord getNewestRecord(); @Override long getLastGeneratedChangeNumber(); @Override DBCursor<ChangeNumberIndexRecord> getCursorFrom(final long startChangeNumber); @Override String toString(); void clear(); void clearAndSetChangeNumber(long newStart); @Override void resetChangeNumberTo(long newFirstCN, DN baseDN, CSN newFirstCSN);  }### Answer:
@Test public void testClear() throws Exception { ReplicationServer replicationServer = null; try { replicationServer = newReplicationServer(false); final ChangelogDB changelogDB = replicationServer.getChangelogDB(); changelogDB.setPurgeDelay(0); final FileChangeNumberIndexDB cnIndexDB = getCNIndexDB(replicationServer); addThreeRecords(cnIndexDB); cnIndexDB.clear(); assertNull(cnIndexDB.getOldestRecord()); assertNull(cnIndexDB.getNewestRecord()); assertEquals(cnIndexDB.count(), 0); assertTrue(cnIndexDB.isEmpty()); } finally { remove(replicationServer); } }