@Test
public void testRetrySettingsBuilder() {

  RetrySettings initialSettings =
      RetrySettings.newBuilder()
          .setInitialRetryDelay(Duration.ofMillis(5))
          .setMaxRetryDelay(Duration.ofSeconds(1))
          .setRetryDelayMultiplier(2)
          .setInitialRpcTimeout(Duration.ofMillis(100))
          .setMaxRpcTimeout(Duration.ofMillis(200))
          .setRpcTimeoutMultiplier(1.1)
          .setJittered(true)
          .setMaxAttempts(10)
          .build();
  UnaryCallSettings.Builder<Object, Object> builder =
      new UnaryCallSettings.Builder().setRetrySettings(initialSettings);
  builder.retrySettings().setMaxRetryDelay(Duration.ofMinutes(1));
  assertThat(builder.getRetrySettings().getMaxRetryDelay()).isEqualTo(Duration.ofMinutes(1));
  assertThat(builder.build().getRetrySettings().getMaxRetryDelay())
      .isEqualTo(Duration.ofMinutes(1));
}