ExponentialBackoffTimeoutStrategy implements TimeoutStrategy { public static long totalBackoffTimeout( long initTimeout, long maxTimeout, long reconCnt ) { long totalBackoffTimeout = initTimeout; for (int i = 1; i < reconCnt && totalBackoffTimeout < maxTimeout; i++) totalBackoffTimeout += backoffTimeout(totalBackoffTimeout, maxTimeout); return totalBackoffTimeout; } ExponentialBackoffTimeoutStrategy(
        long totalTimeout,
        long startTimeout,
        long maxTimeout
    ); static long totalBackoffTimeout(
            long initTimeout,
            long maxTimeout,
            long reconCnt
    ); static long backoffTimeout(long timeout, long maxTimeout); @Override long nextTimeout(long timeout); @Override boolean checkTimeout(long timeInFut); @Override String toString();  }
@Test public void totalBackoffTimeout() { assertEquals(8_000, ExponentialBackoffTimeoutStrategy.totalBackoffTimeout(1000, 5000, 3)); assertEquals(45_000, ExponentialBackoffTimeoutStrategy.totalBackoffTimeout(5_000, 60_000, 3)); }