private boolean shouldRetry(ApiException exception) {
    return exceptionsAllowedToRetry.contains(exception.getClass())
        && cumulativeSleepTime < errorTimeOut
        && (maxRetries == null || retryCounter < maxRetries);
  }
@param request HTTP request to execute.
@param client The client used to execute the request.
@param responseClass Model class to unmarshal JSON body content.
@param fieldNamingPolicy FieldNamingPolicy for unmarshaling JSON.
@param errorTimeOut Number of milliseconds to re-send erroring requests.
@param maxRetries Number of times allowed to re-send erroring requests.
src/main/java/com/google/maps/internal/GaePendingResult.java