code: protected void setHeaders(BasicMessage basicMessage, Map<String, String> headers, Message destination)
              throws JMSException {
          log.infof("Setting [%s] = [%s] on a message of type [%s]", MessageProcessor.HEADER_BASIC_MESSAGE_CLASS,
                  basicMessage.getClass().getName(), destination.getClass().getName());
          destination.setStringProperty(MessageProcessor.HEADER_BASIC_MESSAGE_CLASS, basicMessage.getClass().getName());
  
          // if the basicMessage has headers, use those first
          Map<String, String> basicMessageHeaders = basicMessage.getHeaders();
          if (basicMessageHeaders != null) {
              for (Map.Entry<String, String> entry : basicMessageHeaders.entrySet()) {
                  destination.setStringProperty(entry.getKey(), entry.getValue());
              }
          }
  
          // If we were given headers separately, add those now.
          // Notice these will override same-named headers that were found in the basic message itself.
          if (headers != null) {
              for (Map.Entry<String, String> entry : headers.entrySet()) {
                  destination.setStringProperty(entry.getKey(), entry.getValue());
              }
          }
      }
docs: First sets the {@link MessageProcessor#HEADER_BASIC_MESSAGE_CLASS} string property of {@code destination} to
  {@code basicMessage.getClass().getName()}, then copies all headers from {@code basicMessage.getHeaders()} to
  {@code destination} using {@link Message#setStringProperty(String, String)} and then does the same thing with the
  supplied {@code headers}.
  
  @param basicMessage the {@link BasicMessage} to copy headers from
  @param headers the headers to copy to {@code destination}
  @param destination the {@link Message} to copy the headers to
  @throws JMSException