@Test
public void testCreateNextAttempt() {

  TimedAttemptSettings firstAttempt = algorithm.createFirstAttempt();
  TimedAttemptSettings secondAttempt = algorithm.createNextAttempt(firstAttempt);
  // Checking only the most core values, to not make this test too implementation specific.
  assertEquals(1, secondAttempt.getAttemptCount());
  assertEquals(1, secondAttempt.getOverallAttemptCount());
  assertEquals(Duration.ofMillis(1L), secondAttempt.getRetryDelay());
  assertEquals(Duration.ofMillis(1L), secondAttempt.getRandomizedRetryDelay());
  assertEquals(Duration.ofMillis(2L), secondAttempt.getRpcTimeout());
  TimedAttemptSettings thirdAttempt = algorithm.createNextAttempt(secondAttempt);
  assertEquals(2, thirdAttempt.getAttemptCount());
  assertEquals(Duration.ofMillis(2L), thirdAttempt.getRetryDelay());
  assertEquals(Duration.ofMillis(2L), thirdAttempt.getRandomizedRetryDelay());
  assertEquals(Duration.ofMillis(4L), thirdAttempt.getRpcTimeout());
}