@Override
    public long nextDelayDuration(int reconsumeTimes) {
        if (reconsumeTimes < 0) {
            reconsumeTimes = 0;
        }
        if (reconsumeTimes > 32) {
            reconsumeTimes = 32;
        }
        return Math.min(max, initial * (long) Math.pow(multiplier, reconsumeTimes));
    }
@Test
    public void testNextDelayDurationOutOfRange() {
        ExponentialRetryPolicy exponentialRetryPolicy = new ExponentialRetryPolicy();
        long actual = exponentialRetryPolicy.nextDelayDuration(-1);
        assertThat(actual).isEqualTo(TimeUnit.SECONDS.toMillis(5));
        actual = exponentialRetryPolicy.nextDelayDuration(100);
        assertThat(actual).isEqualTo(TimeUnit.HOURS.toMillis(2));
    }