@Test
public void testMaxRetryCount() throws Exception  {

  ExponentialBackoffRetryHandler handler = new ExponentialBackoffRetryHandler(3, Duration.ZERO, Duration.ZERO, sleeper);
  doReturn(true).when(sleeper).sleep(any(Duration.class));
  assertThat(handler.retryRequest(mock(IOException.class), 3), is(true));
  assertThat(handler.retryRequest(mock(IOException.class), 4), is(false));
}