class TraceMongoCommandListener implements CommandListener {

  @Nullable String getCollectionName(BsonDocument command, String commandName) {
    if (COMMANDS_WITH_COLLECTION_NAME.contains(commandName)) {
      String collectionName = getNonEmptyBsonString(command.get(commandName));
      if (collectionName != null) {
        return collectionName;
      }
    }
    // Some other commands, like getMore, have a field like {"collection": collectionName}.
    return getNonEmptyBsonString(command.get("collection"));
  }

    TraceMongoCommandListener(MongoDBTracing mongoDBTracing);
    TraceMongoCommandListener(ThreadLocalSpan threadLocalSpan);

}