docs: public static void createAndRegister(StackdriverTraceConfiguration configuration)
        throws IOException {
      synchronized (monitor) {
        checkState(handler == null, "Stackdriver exporter is already registered.");
        Credentials credentials = configuration.getCredentials();
        String projectId = configuration.getProjectId();
  
        StackdriverV2ExporterHandler handler;
        TraceServiceStub stub = configuration.getTraceServiceStub();
        if (stub == null) {
          handler =
              StackdriverV2ExporterHandler.createWithCredentials(
                  projectId,
                  credentials != null ? credentials : GoogleCredentials.getApplicationDefault(),
                  configuration.getFixedAttributes());
        } else {
          handler =
              StackdriverV2ExporterHandler.createWithStub(
                  projectId, TraceServiceClient.create(stub), configuration.getFixedAttributes());
        }
  
        registerInternal(handler);
      }
    }