public boolean shouldRetry(RetryContext retryContext,
      int errorCode) {
    ContainerRetryContext containerRC = retryContext.containerRetryContext;
    Preconditions.checkNotNull(containerRC, "container retry context null");
    ContainerRetryPolicy retryPolicy = containerRC.getRetryPolicy();
    if (retryPolicy == ContainerRetryPolicy.RETRY_ON_ALL_ERRORS
        || (retryPolicy == ContainerRetryPolicy.RETRY_ON_SPECIFIC_ERROR_CODES
        && containerRC.getErrorCodes() != null
        && containerRC.getErrorCodes().contains(errorCode))) {
      return containerRC.getMaxRetries() == ContainerRetryContext.RETRY_FOREVER
          || calculateRemainingRetries(retryContext) > 0;
    }
    return false;
  }
@Test
  public void testAlwaysRetry() {
    ContainerRetryContext retryContext =  ContainerRetryContext.newInstance(
        ContainerRetryPolicy.RETRY_ON_ALL_ERRORS, null, -1,
        0, 10);
    SlidingWindowRetryPolicy.RetryContext windowContext = new
        SlidingWindowRetryPolicy.RetryContext(retryContext);
    Assert.assertTrue("always retry", retryPolicy.shouldRetry(windowContext,
        12));
    Assert.assertEquals("remaining retries",
        ContainerRetryContext.RETRY_FOREVER,
        windowContext.getRemainingRetries());
  }