### Question:
BackoffRetryInterval implements RetryInterval { @Override public long getInterval(RetryContext retryContext) { if (retryContext.getAttempts() == 1) { return this.interval; } long interval = (retryContext.getAttempts() - 1) * (this.interval * this.multiplier); return (interval < this.maxInterval) ? interval : this.maxInterval; } BackoffRetryInterval(long interval, long multiplier, long maxInterval); @Override long getInterval(RetryContext retryContext);  }### Answer:
@Test void getInterval_shouldApplyMultiplier() { BackoffRetryInterval interval = new BackoffRetryInterval(1000, 2, 10000); assertThat(interval.getInterval(new RetryContext(1, null, null))) .isEqualTo(1000); assertThat(interval.getInterval(new RetryContext(2, null, null))) .isEqualTo(2000); assertThat(interval.getInterval(new RetryContext(3, null, null))) .isEqualTo(4000); }
@Test void getInterval_shouldNotExceedMax() { BackoffRetryInterval interval = new BackoffRetryInterval(1000, 2, 10000); assertThat(interval.getInterval(new RetryContext(5, null, null))) .isEqualTo(8000); assertThat(interval.getInterval(new RetryContext(6, null, null))) .isEqualTo(10000); assertThat(interval.getInterval(new RetryContext(7, null, null))) .isEqualTo(10000); }