@Test
public void stopsAfterAttempts() throws Exception {

  BackOff backoff = new RetryBoundedBackOff(5, new BackOffTester());
  for (int i = 0; i < 5; i++) {
    assertThat(i + 1).isEqualTo(backoff.nextBackOffMillis());
  }
  assertThat(backoff.nextBackOffMillis()).isEqualTo(BackOff.STOP);
  assertThat(backoff.nextBackOffMillis()).isEqualTo(BackOff.STOP);
}