code: public static void updateStatusType(ResponseStatus status, int statusCode, Set<String> errorCodeWhitelist) {
      if (statusCode >= 300 & statusCode < 500) {
        List<String> whitelist = new ArrayList<>();
        whitelist.add(Integer.toString(statusCode));
        if (statusCode > 400) {
          whitelist.add(HttpConstants.CODE_4XX);
        } else {
          whitelist.add(HttpConstants.CODE_3XX);
        }
        if (whitelist.stream().anyMatch(errorCodeWhitelist::contains)) {
          status.setType(StatusType.CONTINUE);
        } else {
          status.setType(StatusType.CLIENT_ERROR);
        }
      } else if (statusCode >= 500) {
        List<String> whitelist = Arrays.asList(Integer.toString(statusCode), HttpConstants.CODE_5XX);
        if (whitelist.stream().anyMatch(errorCodeWhitelist::contains)) {
          status.setType(StatusType.CONTINUE);
        } else {
          status.setType(StatusType.SERVER_ERROR);
        }
      }
    }
docs: Update {@link StatusType} of a {@link ResponseStatus} based on statusCode and error code white list
  
  @param status a status report after handling the a response
  @param statusCode a status code in http domain
  @param errorCodeWhitelist a whitelist specifies what http error codes are tolerable