@Test
public void testBuilder() {

  @SuppressWarnings("unchecked")
  PagedListResponseFactory<Integer, String, Long> pagedListResponseFactory =
      Mockito.mock(PagedListResponseFactory.class);
  PagedCallSettings.Builder<Integer, String, Long> builder =
      PagedCallSettings.newBuilder(pagedListResponseFactory);
  Set<StatusCode.Code> retryCodes = Sets.newHashSet(Code.UNAVAILABLE);
  RetrySettings retrySettings =
      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();
  builder.setRetryableCodes(retryCodes);
  builder.setRetrySettings(retrySettings);
  Truth.assertThat(builder.getRetryableCodes().size()).isEqualTo(1);
  Truth.assertThat(builder.getRetrySettings()).isEqualTo(retrySettings);
  PagedCallSettings settings = builder.build();
  Truth.assertThat(settings.getRetryableCodes().size()).isEqualTo(1);
  Truth.assertThat(settings.getRetrySettings()).isEqualTo(retrySettings);
}