### Question:
AbstractMongoDatabase implements MongoDatabase { @Override public CompletionStage<Document> handleCommandAsync(Channel channel, String command, Document query, Oplog oplog) { Document commandErrorDocument = commandError(channel, command, query); if (commandErrorDocument != null) { return FutureUtils.wrap(() -> commandErrorDocument); } clearLastStatus(channel); if ("find".equalsIgnoreCase(command)) { return commandFindAsync(command, query); } return FutureUtils.wrap(() -> handleCommandSync(channel, command, query, oplog)); } protected  AbstractMongoDatabase(String databaseName, CursorRegistry cursorRegistry); @Override final String getDatabaseName(); @Override String toString(); @Override Document handleCommand(Channel channel, String command, Document query, Oplog oplog); @Override CompletionStage<Document> handleCommandAsync(Channel channel, String command, Document query, Oplog oplog); @Override MongoCollection<P> createCollectionOrThrowIfExists(String collectionName, CollectionOptions options); @Override QueryResult handleQuery(MongoQuery query); @Override CompletionStage<QueryResult> handleQueryAsync(MongoQuery query); @Override void handleClose(Channel channel); @Override void handleInsert(MongoInsert insert, Oplog oplog); @Override MongoCollection<P> resolveCollection(String collectionName, boolean throwIfNotFound); @Override boolean isEmpty(); @Override void handleDelete(MongoDelete delete, Oplog oplog); @Override void handleUpdate(MongoUpdate updateCommand, Oplog oplog); @Override void drop(Oplog oplog); @Override void dropCollection(String collectionName, Oplog oplog); @Override void unregisterCollection(String collectionName); @Override void moveCollection(MongoDatabase oldDatabase, MongoCollection<?> collection, String newCollectionName);  }### Answer:
@Test void testHandleCommandAsyncFindReturnEmpty() throws Exception { Channel channel = Mockito.mock(Channel.class); Document query = new Document(); query.put("find", "testCollection"); CompletionStage<Document> responseFuture = database.handleCommandAsync(channel, "find", query, null); Document response = responseFuture.toCompletableFuture().get(); assertThat(response).isNotNull(); assertThat(response.get("ok")).isEqualTo(1.0); }
@Test void testHandleCommandAsyncFindReturnSomething() throws Exception { Channel channel = Mockito.mock(Channel.class); Document query = new Document(); query.put("find", "mockCollection"); CompletionStage<Document> responseFuture = database.handleCommandAsync(channel, "find", query, null); Document response = responseFuture.toCompletableFuture().get(); assertThat(response).isNotNull(); assertThat(response.get("ok")).isEqualTo(1.0); Document cursor = (Document) response.get("cursor"); assertThat(cursor).isNotNull(); List<Document> firstBatch = (List<Document>) cursor.get("firstBatch"); assertThat(firstBatch).isNotNull(); assertThat(firstBatch).hasSize(1); Document doc = firstBatch.get(0); assertThat(doc).isNotNull(); assertThat(doc.get("_id")).isEqualTo(1); }