code: private Map<String, Object> convertHeaderTypes(Map<String, Object> headers) {
          Map<String, Object> convertedHeaders = new HashMap<>();
  
          for (Map.Entry<String, Object> header : headers.entrySet()) {
              if (header.getValue() instanceof Collection<?>) {
                  Collection<?> value = (Collection<?>)header.getValue();
                  convertedHeaders.put(header.getKey(), StringUtils.collectionToCommaDelimitedString(value));
              } else if (header.getValue() instanceof MediaType) {
                  convertedHeaders.put(header.getKey(), header.getValue().toString());
              } else {
                  convertedHeaders.put(header.getKey(), header.getValue());
              }
          }
  
          return convertedHeaders;
      }
docs: Checks for collection typed header values and convert them to comma delimited String.
  We need this for further header processing e.g when forwarding headers to JMS queues.
  
  @param headers the http request headers.