@Override
    public boolean shouldRetry(RetryPolicyContext context) {
        return context.retriesAttempted() < maxNumberOfRetries;
    }
Simple retry condition that allows retries up to a certain max number of retries.
aws-java-sdk-core/src/main/java/com/amazonaws/retry/v2/MaxNumberOfRetriesCondition.java