@Test void testGetInterval() { assertThat(new DoublingRetrySchedule(0, 8).getInterval(0)).isEqualTo(0); assertThat(new DoublingRetrySchedule(0, 8).getInterval(1)).isEqualTo(1); assertThat(new DoublingRetrySchedule(0, 8).getInterval(2)).isEqualTo(2); assertThat(new DoublingRetrySchedule(0, 8).getInterval(3)).isEqualTo(4); assertThat(new DoublingRetrySchedule(0, 8).getInterval(4)).isEqualTo(8); assertThat(new DoublingRetrySchedule(0, 8).getInterval(5)).isEqualTo(8); assertThat(new DoublingRetrySchedule(1, 8).getInterval(0)).isEqualTo(1); assertThat(new DoublingRetrySchedule(1, 8).getInterval(1)).isEqualTo(2); assertThat(new DoublingRetrySchedule(1, 8).getInterval(2)).isEqualTo(4); assertThat(new DoublingRetrySchedule(1, 8).getInterval(3)).isEqualTo(8); assertThat(new DoublingRetrySchedule(1, 8).getInterval(4)).isEqualTo(8); assertThat(new DoublingRetrySchedule(3, 12).getInterval(0)).isEqualTo(3); assertThat(new DoublingRetrySchedule(3, 12).getInterval(1)).isEqualTo(6); assertThat(new DoublingRetrySchedule(3, 12).getInterval(2)).isEqualTo(12); assertThat(new DoublingRetrySchedule(3, 12).getInterval(3)).isEqualTo(12); assertThat(new DoublingRetrySchedule(0, 8, 1000).getInterval(0)).isEqualTo(0); assertThat(new DoublingRetrySchedule(0, 8, 1000).getInterval(1)).isEqualTo(1000); assertThat(new DoublingRetrySchedule(0, 8, 1000).getInterval(2)).isEqualTo(2000); assertThat(new DoublingRetrySchedule(0, 8, 1000).getInterval(3)).isEqualTo(4000); assertThat(new DoublingRetrySchedule(0, 8, 1000).getInterval(4)).isEqualTo(8000); assertThat(new DoublingRetrySchedule(0, 8, 1000).getInterval(5)).isEqualTo(8000); }
@Override public long getInterval(int index) { if (startInterval > 0) { return getInterval(index, startInterval); } return index == 0 ? 0 : getInterval(index - 1, 1); }
DoublingRetrySchedule implements RetrySchedule { @Override public long getInterval(int index) { if (startInterval > 0) { return getInterval(index, startInterval); } return index == 0 ? 0 : getInterval(index - 1, 1); } }
DoublingRetrySchedule implements RetrySchedule { @Override public long getInterval(int index) { if (startInterval > 0) { return getInterval(index, startInterval); } return index == 0 ? 0 : getInterval(index - 1, 1); } private  DoublingRetrySchedule();  DoublingRetrySchedule(long startInterval, long maxInterval);  DoublingRetrySchedule(long startInterval, long maxInterval, int multiplier); }
DoublingRetrySchedule implements RetrySchedule { @Override public long getInterval(int index) { if (startInterval > 0) { return getInterval(index, startInterval); } return index == 0 ? 0 : getInterval(index - 1, 1); } private  DoublingRetrySchedule();  DoublingRetrySchedule(long startInterval, long maxInterval);  DoublingRetrySchedule(long startInterval, long maxInterval, int multiplier); @Override long getInterval(int index); @Override String toString(); }
DoublingRetrySchedule implements RetrySchedule { @Override public long getInterval(int index) { if (startInterval > 0) { return getInterval(index, startInterval); } return index == 0 ? 0 : getInterval(index - 1, 1); } private  DoublingRetrySchedule();  DoublingRetrySchedule(long startInterval, long maxInterval);  DoublingRetrySchedule(long startInterval, long maxInterval, int multiplier); @Override long getInterval(int index); @Override String toString();  }