RetryNTimes extends SleepingRetry { @Override protected long getSleepTimeMs(int numAttempts, long elapsedTimeMs) { return _sleepTimeBetweenAttemptsMillis; } RetryNTimes(int maxNumAttempts);  RetryNTimes(int maxNumAttempts, long sleepTimeBetweenRetries, TimeUnit unit);   }
@Test public void testPositiveSleepTime() { RetryNTimes retry = new RetryNTimes(1, 123, TimeUnit.MILLISECONDS); assertEquals(123, retry.getSleepTimeMs(1, 0)); assertEquals(123, retry.getSleepTimeMs(1, 1)); }
@Test public void testPositiveSleepUnits() { RetryNTimes retry = new RetryNTimes(1, 123, TimeUnit.SECONDS); assertEquals(TimeUnit.SECONDS.toMillis(123), retry.getSleepTimeMs(1, 0)); }