static BigtableDataSettings translateWriteToVeneerSettings(
      @NonNull BigtableConfig config,
      @NonNull BigtableWriteOptions options,
      @Nullable BigtableWriteOptions optionsFromBigtableOptions,
      @NonNull PipelineOptions pipelineOptions)
      throws IOException {

    BigtableDataSettings.Builder settings = buildBigtableDataSettings(config, pipelineOptions);
    return configureWriteSettings(settings, options, optionsFromBigtableOptions);
  }
@Test
  public void testVeneerWriteSettings() throws Exception {
    BigtableConfig config =
        BigtableConfig.builder()
            .setProjectId(ValueProvider.StaticValueProvider.of("project"))
            .setInstanceId(ValueProvider.StaticValueProvider.of("instance"))
            .setAppProfileId(ValueProvider.StaticValueProvider.of("app"))
            .setValidate(true)
            .build();
    BigtableWriteOptions writeOptions =
        BigtableWriteOptions.builder()
            .setTableId(ValueProvider.StaticValueProvider.of("table"))
            .setAttemptTimeout(org.joda.time.Duration.millis(101))
            .setOperationTimeout(org.joda.time.Duration.millis(1001))
            .setMaxElementsPerBatch(105)
            .setMaxBytesPerBatch(102)
            .setMaxOutstandingElements(10001)
            .setMaxOutstandingBytes(100001)
            .build();

    PipelineOptions pipelineOptions = PipelineOptionsFactory.as(GcpOptions.class);

    BigtableDataSettings settings =
        BigtableConfigTranslator.translateWriteToVeneerSettings(
            config, writeOptions, null, pipelineOptions);

    EnhancedBigtableStubSettings stubSettings = settings.getStubSettings();

    assertEquals(config.getProjectId().get(), stubSettings.getProjectId());
    assertEquals(config.getInstanceId().get(), stubSettings.getInstanceId());
    assertEquals(config.getAppProfileId().get(), stubSettings.getAppProfileId());
    assertEquals(
        Duration.ofMillis(101),
        stubSettings.bulkMutateRowsSettings().getRetrySettings().getInitialRpcTimeout());
    assertEquals(
        Duration.ofMillis(1001),
        stubSettings.bulkMutateRowsSettings().getRetrySettings().getTotalTimeout());
    assertEquals(
        105,
        (long)
            stubSettings.bulkMutateRowsSettings().getBatchingSettings().getElementCountThreshold());
    assertEquals(
        102,
        (long)
            stubSettings.bulkMutateRowsSettings().getBatchingSettings().getRequestByteThreshold());
    assertEquals(
        10001,
        (long)
            stubSettings
                .bulkMutateRowsSettings()
                .getBatchingSettings()
                .getFlowControlSettings()
                .getMaxOutstandingElementCount());

    assertEquals(
        100001,
        (long)
            stubSettings
                .bulkMutateRowsSettings()
                .getBatchingSettings()
                .getFlowControlSettings()
                .getMaxOutstandingRequestBytes());
  }