code: private <T, E> void parseAndCallback(
        RequestInfo<T, E> requestInfo, int statusCode, HttpResponse response)
        throws IOException {
      BatchCallback<T, E> callback = requestInfo.callback;
  
      HttpHeaders responseHeaders = response.getHeaders();
      HttpUnsuccessfulResponseHandler unsuccessfulResponseHandler =
          requestInfo.request.getUnsuccessfulResponseHandler();
  
      if (HttpStatusCodes.isSuccess(statusCode)) {
        if (callback == null) {
          // No point in parsing if there is no callback.
          return;
        }
        T parsed = getParsedDataClass(requestInfo.dataClass, response, requestInfo);
        callback.onSuccess(parsed, responseHeaders);
      } else {
        HttpContent content = requestInfo.request.getContent();
        boolean retrySupported = retryAllowed && (content == null || content.retrySupported());
        boolean errorHandled = false;
        boolean redirectRequest = false;
        if (unsuccessfulResponseHandler != null) {
          errorHandled = unsuccessfulResponseHandler.handleResponse(
              requestInfo.request, response, retrySupported);
        }
        if (!errorHandled) {
          if (requestInfo.request.handleRedirect(response.getStatusCode(), response.getHeaders())) {
            redirectRequest = true;
          }
        }
        if (retrySupported && (errorHandled || redirectRequest)) {
          unsuccessfulRequestInfos.add(requestInfo);
        } else {
          if (callback == null) {
            // No point in parsing if there is no callback.
            return;
          }
          E parsed = getParsedDataClass(requestInfo.errorClass, response, requestInfo);
          callback.onFailure(parsed, responseHeaders);
        }
      }
    }
docs: Parse an object into a new instance of the data class using
  {@link HttpResponse#parseAs(java.lang.reflect.Type)}.