### Question:
FileReplicaDB { DBCursor<UpdateMsg> generateCursorFrom(final CSN startCSN, final KeyMatchingStrategy matchingStrategy, final PositionStrategy positionStrategy) throws ChangelogException { RepositionableCursor<CSN, UpdateMsg> cursor = log.getCursor(startCSN, matchingStrategy, positionStrategy); CSN actualStartCSN = (startCSN != null && startCSN.getServerId() == serverId) ? startCSN : null; return new FileReplicaDBCursor(cursor, actualStartCSN, positionStrategy); } FileReplicaDB(final int serverId, final DN baseDN, final ReplicationServer replicationServer,
      final ReplicationEnvironment replicationEnv); @Override String toString();  }### Answer:
@Test public void testGenerateCursorFrom() throws Exception { ReplicationServer replicationServer = null; FileReplicaDB replicaDB = null; try { TestCaseUtils.startServer(); replicationServer = configureReplicationServer(100000, 10); replicaDB = newReplicaDB(replicationServer); final CSN[] csns = generateCSNs(1, System.currentTimeMillis(), 5); final ArrayList<CSN> csns2 = newArrayList(csns); csns2.remove(csns[3]); for (CSN csn : csns2) { replicaDB.add(new DeleteMsg(TEST_ROOT_DN, csn, "uid")); } waitChangesArePersisted(replicaDB, 4); for (CSN csn : csns2) { assertNextCSN(replicaDB, csn, ON_MATCHING_KEY, csn); } assertNextCSN(replicaDB, csns[3], ON_MATCHING_KEY, csns[4]); for (int i = 0; i < csns2.size() - 1; i++) { assertNextCSN(replicaDB, csns2.get(i), AFTER_MATCHING_KEY, csns2.get(i + 1)); } assertNotFound(replicaDB, csns[4], AFTER_MATCHING_KEY); } finally { shutdown(replicaDB); remove(replicationServer); } }