@Override
    public long nextDelayDuration(int renewTimes) {
        if (renewTimes < 0) {
            renewTimes = 0;
        }
        int index = renewTimes;
        if (index >= next.length) {
            index = next.length - 1;
        }
        return next[index];
    }
@Test
    public void testNextDelayDuration() {
        long value = this.retryPolicy.nextDelayDuration(times.getAndIncrement());
        assertEquals(value, TimeUnit.MINUTES.toMillis(1));

        value = this.retryPolicy.nextDelayDuration(times.getAndIncrement());
        assertEquals(value, TimeUnit.MINUTES.toMillis(3));

        value = this.retryPolicy.nextDelayDuration(times.getAndIncrement());
        assertEquals(value, TimeUnit.MINUTES.toMillis(5));

        value = this.retryPolicy.nextDelayDuration(times.getAndIncrement());
        assertEquals(value, TimeUnit.MINUTES.toMillis(10));

        value = this.retryPolicy.nextDelayDuration(times.getAndIncrement());
        assertEquals(value, TimeUnit.MINUTES.toMillis(30));

        value = this.retryPolicy.nextDelayDuration(times.getAndIncrement());
        assertEquals(value, TimeUnit.HOURS.toMillis(1));
    }