### Question:
AbstractMongoBackend implements MongoBackend { @Override public void handleKillCursors(MongoKillCursors killCursors) { killCursors.getCursorIds().forEach(cursorRegistry::remove); } protected  AbstractMongoBackend(); protected  AbstractMongoBackend(Clock clock); @Override MongoDatabase resolveDatabase(String databaseName); @Override Document getServerStatus(); @Override Document handleCommand(Channel channel, String databaseName, String command, Document query); @Override CompletionStage<Document> handleCommandAsync(Channel channel, String database,
                                                        String command, Document query); @Override Collection<Document> getCurrentOperations(MongoQuery query); @Override QueryResult handleQuery(MongoQuery query); @Override CompletionStage<QueryResult> handleQueryAsync(MongoQuery query); @Override QueryResult handleGetMore(long cursorId, int numberToReturn); @Override QueryResult handleGetMore(MongoGetMore getMore); @Override void handleInsert(MongoInsert insert); @Override CompletionStage<Void> handleInsertAsync(MongoInsert insert); @Override void handleDelete(MongoDelete delete); @Override CompletionStage<Void> handleDeleteAsync(MongoDelete delete); @Override void handleUpdate(MongoUpdate update); @Override CompletionStage<Void> handleUpdateAsync(MongoUpdate update); @Override void handleKillCursors(MongoKillCursors killCursors); @Override Document handleMessage(MongoMessage message); @Override void dropDatabase(String databaseName); @Override void handleClose(Channel channel); @Override void close(); @Override MongoBackend version(ServerVersion version); @Override Clock getClock(); @Override void disableOplog(); @Override void enableOplog();  }### Answer:
@Test void testHandleKillCursor() { InMemoryCursor cursor1 = new InMemoryCursor(cursorRegistry.generateCursorId(), Collections.singletonList(new Document())); InMemoryCursor cursor2 = new InMemoryCursor(cursorRegistry.generateCursorId(), Collections.singletonList(new Document())); cursorRegistry.add(cursor1); cursorRegistry.add(cursor2); assertThat(cursorRegistry.getCursor(cursor1.getId())).isNotNull(); assertThat(cursorRegistry.getCursor(cursor2.getId())).isNotNull(); MongoKillCursors killCursors = new MongoKillCursors(null, null, Collections.singletonList(cursor1.getId())); backend.handleKillCursors(killCursors); assertThatExceptionOfType(CursorNotFoundException.class) .isThrownBy(() -> cursorRegistry.getCursor(cursor1.getId())) .withMessage("[Error 43] Cursor id 1 does not exists"); assertThat(cursorRegistry.getCursor(cursor2.getId())).isNotNull(); }