### Question:
BackoffRetryManager implements RetryManager { public int secondsBeforeRetry (Notification notification) { int delay = (int) Math.ceil((Math.pow(2, notification.getDeliveryAttempts()) - 1) / 2); return delay > MAX_BACKOFF_DELAY ? MAX_BACKOFF_DELAY : delay; }  boolean hasExpired(Notification notification); int maxAllowableRetriesForNotification(Notification notification); int secondsBeforeRetry(Notification notification); static final int MAX_BACKOFF_DELAY; }### Answer:
@Test public void shouldReturnExponentialBackoffTimes () { Notification notification = new NotificationBuilder().build(); for (int i = 0; i < 20; i++) { int actualDelay = uut.secondsBeforeRetry(notification); int calculatedDelay = (int) Math.ceil((Math.pow(2, notification.getDeliveryAttempts()) - 1) / 2); int expectedDelay = calculatedDelay > BackoffRetryManager.MAX_BACKOFF_DELAY ? BackoffRetryManager.MAX_BACKOFF_DELAY : calculatedDelay; assertEquals(expectedDelay, actualDelay); } }