ExponentialBackOff implements BackOff { @Override public void reset() { currentIntervalMillis = initialIntervalMillis; numberOfRetries = 0; } ExponentialBackOff();  ExponentialBackOff(Builder builder); @Override long getBackOffInMillis(); @Override void reset(); long getInitialIntervalMillis(); long getMaximumIntervalMillis(); double getRandomizationFactor(); double getMultiplier(); int getMaximumRetries(); int getNumberOfRetries(); static final long INITIAL_INTERVAL_MILLIS; static final long MAXIMUM_INTERVAL_MILLIS; static final double RANDOMIZATION_FACTOR; static final double MULTIPLIER; static final int MAXIMUM_RETRIES; }
@Test public void testReset() { ExponentialBackOff backOff = new ExponentialBackOff.Builder() .setRandomizationFactor(0) .setMultiplier(1) .build(); backOff.getBackOffInMillis(); backOff.getBackOffInMillis(); backOff.reset(); assertEquals(0, backOff.getNumberOfRetries()); assertEquals(backOff.getInitialIntervalMillis(), backOff.getBackOffInMillis()); }