private static <T> T doProcess(RequestBuilderImpl builder, RequestProcessor<T> processor) throws IOException {
    try (RequestImpl request = new RequestImpl(builder)) {
      T result = processor.process(request);

      if (builder.myThrowStatusCodeException) {
        URLConnection connection = request.myConnection;
        if (connection != null && connection.getDoOutput()) {
          // getResponseCode is not checked on connect, because writing must happen before reading
          HttpURLConnection urlConnection = (HttpURLConnection)connection;
          int responseCode = urlConnection.getResponseCode();
          if (responseCode >= 400) {
            throwHttpStatusError(urlConnection, request, builder, responseCode);
          }
        }
      }

      return result;
    }
  }
private static <T> T doProcess(RequestBuilderImpl builder, RequestProcessor<T> processor)