@Override
    public long nextDelayDuration(int reconsumeTimes) {
        if (reconsumeTimes < 0) {
            reconsumeTimes = 0;
        }
        int index = reconsumeTimes + 2;
        if (index >= next.length) {
            index = next.length - 1;
        }
        return next[index];
    }
@Test
    public void testNextDelayDurationOutOfRange() {
        CustomizedRetryPolicy customizedRetryPolicy = new CustomizedRetryPolicy();
        long actual = customizedRetryPolicy.nextDelayDuration(-1);
        assertThat(actual).isEqualTo(TimeUnit.SECONDS.toMillis(10));
        actual = customizedRetryPolicy.nextDelayDuration(100);
        assertThat(actual).isEqualTo(TimeUnit.HOURS.toMillis(2));
    }