docs: private void applyResponseOverrides(PluginResponse httpServletResponse,
                                          HttpServletRequest httpServletRequest, HttpMethod httpMethodProxyRequest, History history) throws Exception {
          RequestInformation requestInfo = requestInformation.get();
  
          for (EndpointOverride selectedPath : requestInfo.selectedResponsePaths) {
              // check to see if there is custom override data
              // something like
              List<EnabledEndpoint> points = selectedPath.getEnabledEndpoints();
              for (EnabledEndpoint endpoint : points) {
                  // skip if the repeat number is 0
                  if (endpoint.getRepeatNumber() == 0) {
                      continue;
                  }
  
                  // skip if this is a custom override and one has already been applied
                  if (endpoint.getOverrideId() == Constants.PLUGIN_RESPONSE_OVERRIDE_CUSTOM &&
                      requestInfo.usedCustomResponse) {
                      continue;
                  }
  
                  // decrease repeat number
                  endpoint.decrementRepeatNumber();
  
                  if (endpoint.getOverrideId() == Constants.PLUGIN_RESPONSE_OVERRIDE_CUSTOM) {
                      // return custom response
                      String response = endpoint.getArguments()[0].toString();
                      String responseCode = endpoint.getResponseCode();
                      if (responseCode != null && !responseCode.isEmpty()) {
                          httpServletResponse.setStatus(Integer.parseInt(responseCode));
                      }
                      httpServletResponse.setContentType(selectedPath.getContentType());
                      requestInfo.usedCustomResponse = true;
                      requestInfo.modified = true;
                      PluginHelper.writeResponseContent(httpServletResponse, response);
                  } else if (endpoint.getOverrideId() == Constants.PLUGIN_RESPONSE_HEADER_OVERRIDE_ADD) {
                      httpServletResponse = (PluginResponse) HttpUtilities.addHeader(httpServletResponse, endpoint.getArguments());
                      requestInfo.modified = true;
                  } else if (endpoint.getMethodInformation() != null &&
                      (endpoint.getMethodInformation().getMethodType().equals(Constants.PLUGIN_TYPE_RESPONSE_OVERRIDE) ||
                          endpoint.getMethodInformation().getMethodType().equals(Constants.PLUGIN_TYPE_RESPONSE_OVERRIDE_V2))) {
                      // run method
                      try {
                          com.groupon.odo.proxylib.models.Method methodInfo =
                              PathOverrideService.getInstance().getMethodForEnabledId(endpoint.getOverrideId());
  
                          logger.info("method = {}", methodInfo);
                          logger.info("Enabled endpoint: {}", methodInfo.getMethodName());
                          logger.info("Calling override for {}",
                                      httpServletRequest.getRequestURL() + "?" + httpServletRequest.getQueryString());
  
                          // For v1 plugins - verify HTTP code is set correctly
                          if (methodInfo.getOverrideVersion() == 1) {
                              logger.info("Running {}", methodInfo.getMethodName());
                              String responseOutput = (String) PluginManager.getInstance().callFunction(methodInfo.getClassName(), methodInfo.getMethodName(),
                                                                                                        httpServletResponse.getContentString(), endpoint.getArguments());
                              PluginHelper.writeResponseContent(httpServletResponse, responseOutput);
  
                              if (methodInfo.getHttpCode() != httpServletResponse.getStatus()) {
                                  logger.info("Setting HTTP Code to {}", methodInfo.getHttpCode());
                                  httpServletResponse.setStatus(methodInfo.getHttpCode());
                                  // the server might have set a "Status" header.. so let's reset this too
                                  httpServletResponse.setHeader(Constants.HEADER_STATUS,
                                                                Integer.toString(methodInfo.getHttpCode()));
                              }
                          } else if (methodInfo.getOverrideVersion() == 2) {
                              PluginArguments pluginArgs = new PluginArguments(httpServletResponse, requestInfo.originalRequestInfo, httpMethodProxyRequest);
  
                              PluginManager.getInstance().callFunction(
                                  methodInfo.getClassName(), methodInfo.getMethodName(),
                                  pluginArgs, endpoint.getArguments());
                          }
  
                          requestInfo.modified = true;
                          logger.info("Done calling override");
                      } catch (Exception e) {
                          e.printStackTrace();
                      }
                  }
              }
          }
  
          httpServletResponse.flushBuffer();
      }