### Question:
CounterBasedRetryCondition implements RetryCondition { @Override public boolean shouldRetry( AmazonWebServiceRequest originalRequest, AmazonClientException exception, int retriesAttempted) { LOG.debug("Exception caught during upload, retries attempted = {} out of {}", retriesAttempted, maxErrorRetry, exception); return retriesAttempted <= maxErrorRetry; } CounterBasedRetryCondition(int maxErrorRetry); @Override boolean shouldRetry(
      AmazonWebServiceRequest originalRequest,
      AmazonClientException exception,
      int retriesAttempted);  }### Answer:
@Test public void doRetry() { assertThat(condition.shouldRetry(originalRequest, exception, MAX_ERROR_RETRY - 1), is(true)); }
@Test public void doRetryWhenLimitIsReached() { assertThat(condition.shouldRetry(originalRequest, exception, MAX_ERROR_RETRY), is(true)); }
@Test public void doNotRetry() { assertThat(condition.shouldRetry(originalRequest, exception, MAX_ERROR_RETRY + 1), is(false)); }