code: public void transformAndSetForwardedHeader() {
          if (xForwardedForHeader != null && xForwardedByHeader != null) {
              //Transition is not done, as it's not possible to know in which order the existing fields were added.
              LOG.info("Header transition is not done as both X-Forwarded-For and X-Forwarded-By headers are present.");
              return;
          }
          StringBuilder headerValue = new StringBuilder();
          if (xForwardedForHeader != null) {
              String[] parts = xForwardedForHeader.split(COMMA);
              for (String part : parts) {
                  headerValue.append(FOR).append(resolveIP(part.trim())).append(COMMA).append(" ");
              }
              headerValue.replace(headerValue.length() - 2, headerValue.length(), SEMI_COLON + " ");
              httpOutboundRequest.removeHeader(Constants.X_FORWARDED_FOR);
          }
          if (xForwardedByHeader != null) {
              headerValue.append(FOR).append(resolveIP(xForwardedByHeader.trim())).append(SEMI_COLON).append(" ");
              httpOutboundRequest.removeHeader(Constants.X_FORWARDED_BY);
          }
          headerValue.append(BY).append(resolveIP(localAddress));
          if (xForwardedHostHeader != null) {
              headerValue.append(SEMI_COLON + " " + HOST).append(xForwardedHostHeader);
              httpOutboundRequest.removeHeader(Constants.X_FORWARDED_HOST);
          }
          if (xForwardedProtoHeader != null) {
              headerValue.append(SEMI_COLON + " " + PROTO).append(xForwardedProtoHeader);
              httpOutboundRequest.removeHeader(Constants.X_FORWARDED_PROTO);
          }
          httpOutboundRequest.setHeader(Constants.FORWARDED, headerValue.toString());
      }
docs: Transform X-Forwarded-- to Forwarded headers and set to outbound request.
  
  @see <a href="https://tools.ietf.org/html/rfc7239#section-7.4">rfc7239</a>