public long backoff(long attempts) {
        if (expMax == 0) {
            return initialInterval;
        }
        double exp = Math.min(attempts, this.expMax);
        double term = initialInterval * Math.pow(multiplier, exp);
        double randomFactor = jitter < Double.MIN_NORMAL ? 1.0 :
            ThreadLocalRandom.current().nextDouble(1 - jitter, 1 + jitter);
        long backoffValue = (long) (randomFactor * term);
        return Math.min(backoffValue, maxInterval);
    }
@Test
    public void testExponentialBackoffWithoutJitter() {
        ExponentialBackoff exponentialBackoff = new ExponentialBackoff(100, 2, 400, 0.0);
        assertEquals(100, exponentialBackoff.backoff(0));
        assertEquals(200, exponentialBackoff.backoff(1));
        assertEquals(400, exponentialBackoff.backoff(2));
        assertEquals(400, exponentialBackoff.backoff(3));
    }