### Question:
ExponentialWaitStrategy implements WaitStrategy { @Override public long sleepTime(final long attempt) { checkArgument(attempt >= 0, "attempt must not be negative (%d)", attempt); final long exponentialSleepTime = initialWait * Math.round(Math.pow(2, attempt)); return exponentialSleepTime >= 0 && exponentialSleepTime < maxWait ? exponentialSleepTime : maxWait; } ExponentialWaitStrategy(final long initialWait, final long maxWait); @Override long sleepTime(final long attempt);  }### Answer:
@Test public void testMaxSleepTime() { final long sleepTime = new ExponentialWaitStrategy(1, 1).sleepTime(100); assertThat(sleepTime, equalTo(1L)); }
@Test public void testExponentialGrowth() { final ExponentialWaitStrategy exponentialWaitStrategy = new ExponentialWaitStrategy(1, 1000); assertThat(exponentialWaitStrategy.sleepTime(3) / exponentialWaitStrategy.sleepTime(2), equalTo(2L)); }
@Test public void testMaxAttempts() { final long maxWait = 1000; final ExponentialWaitStrategy exponentialWaitStrategy = new ExponentialWaitStrategy(1, maxWait); assertThat(exponentialWaitStrategy.sleepTime(Long.MAX_VALUE), equalTo(maxWait)); }
@Test public void test64Attempts() { final long maxWait = 1000; final ExponentialWaitStrategy exponentialWaitStrategy = new ExponentialWaitStrategy(1, maxWait); assertThat(exponentialWaitStrategy.sleepTime(64), equalTo(maxWait)); }