Buggy code:
public class StompBrokerRelayMessageHandlerIntegrationTests { private static final Log logger = LogFactory . getLog ( StompBrokerRelayMessageHandlerIntegrationTests . class ) ; private static final Charset UTF_8 = Charset . forName ( "UTF-8" ) ; private StompBrokerRelayMessageHandler relay ; private BrokerService activeMQBroker ; private ExecutorSubscribableChannel responseChannel ; private StompBrokerRelayMessageHandlerIntegrationTests . ExpectationMatchingMessageHandler responseHandler ; private StompBrokerRelayMessageHandlerIntegrationTests . ExpectationMatchingEventPublisher eventPublisher ; private int port ; @ Before public void setUp ( ) throws Exception { } private void createAndStartBroker ( ) throws Exception { } @ After public void tearDown ( ) throws Exception { } @ Test public void publishSubscribe ( ) throws Exception { } @ Test public void brokerUnvailableErrorFrameOnConnect ( ) throws Exception { } @ Test ( expected = MessageDeliveryException . class ) public void messageDeliverExceptionIfSystemSessionForwardFails ( ) throws Exception { <START_BUG> StompHeaderAccessor headers = StompHeaderAccessor . create ( MESSAGE ) ; <END_BUG> this . relay . handleMessage ( MessageBuilder . withPayloadAndHeaders ( "test" , headers ) . build ( ) ) ; } @ Test public void brokerBecomingUnvailableTriggersErrorFrame ( ) throws Exception { } @ Test public void brokerAvailabilityEvents ( ) throws Exception { } @ Test public void relayReconnectsIfBrokerComesBackUp ( ) throws Exception { } @ Test public void disconnectClosesRelaySessionCleanly ( ) throws Exception { } private void stopBrokerAndAwait ( ) throws Exception { } private static class ExpectationMatchingMessageHandler implements MessageHandler { private final Object monitor = new Object ( ) ; private final List < StompBrokerRelayMessageHandlerIntegrationTests . MessageExchange > expected ; private final List < StompBrokerRelayMessageHandlerIntegrationTests . MessageExchange > actual = new ArrayList < > ( ) ; private final List < Message < ? > > unexpected = new ArrayList < > ( ) ; public ExpectationMatchingMessageHandler ( StompBrokerRelayMessageHandlerIntegrationTests . MessageExchange ... expected ) { } public void expect ( StompBrokerRelayMessageHandlerIntegrationTests . MessageExchange ... expected ) { } public void awaitAndAssert ( ) throws InterruptedException { } @ Override public void handleMessage ( Message < ? > message ) throws MessagingException { } public String getAsString ( ) { } } private static class MessageExchange { private final Message < ? > message ; private final StompBrokerRelayMessageHandlerIntegrationTests . MessageMatcher [ ] expected ; private final Message < ? > [ ] actual ; public MessageExchange ( Message < ? > message , StompBrokerRelayMessageHandlerIntegrationTests . MessageMatcher ... expected ) { } public boolean isDone ( ) { } public boolean matchMessage ( Message < ? > message ) { } @ Override public String toString ( ) { } } private static class MessageExchangeBuilder { private final Message < ? > message ; private final StompHeaderAccessor headers ; private final List < StompBrokerRelayMessageHandlerIntegrationTests . MessageMatcher > expected = new ArrayList < > ( ) ; private MessageExchangeBuilder ( Message < ? > message ) { } public static StompBrokerRelayMessageHandlerIntegrationTests . MessageExchangeBuilder error ( String sessionId ) { } public static StompBrokerRelayMessageHandlerIntegrationTests . MessageExchangeBuilder connect ( String sessionId ) { } public static StompBrokerRelayMessageHandlerIntegrationTests . MessageExchangeBuilder connectWithError ( String sessionId ) { } public static StompBrokerRelayMessageHandlerIntegrationTests . MessageExchangeBuilder subscribeWithReceipt ( String sessionId , String subscriptionId , String destination , String receiptId ) { } public static StompBrokerRelayMessageHandlerIntegrationTests . MessageExchangeBuilder send ( String destination , String payload ) { } public StompBrokerRelayMessageHandlerIntegrationTests . MessageExchangeBuilder andExpectMessage ( String sessionId , String subscriptionId ) { } public StompBrokerRelayMessageHandlerIntegrationTests . MessageExchangeBuilder andExpectError ( ) { } public StompBrokerRelayMessageHandlerIntegrationTests . MessageExchangeBuilder andExpectError ( String sessionId ) { } public StompBrokerRelayMessageHandlerIntegrationTests . MessageExchange build ( ) { } } private static interface MessageMatcher { boolean match ( Message < ? > message ) { } } private static class StompFrameMessageMatcher implements StompBrokerRelayMessageHandlerIntegrationTests . MessageMatcher { private final StompCommand command ; private final String sessionId ; public StompFrameMessageMatcher ( StompCommand command , String sessionId ) { } @ Override public final boolean match ( Message < ? > message ) { } protected boolean matchInternal ( StompHeaderAccessor headers , Object payload ) { } @ Override public String toString ( ) { } } private static class StompReceiptFrameMessageMatcher extends StompBrokerRelayMessageHandlerIntegrationTests . StompFrameMessageMatcher { private final String receiptId ; public StompReceiptFrameMessageMatcher ( String sessionId , String receipt ) { } @ Override protected boolean matchInternal ( StompHeaderAccessor headers , Object payload ) { } @ Override public String toString ( ) { } } private static class StompMessageFrameMessageMatcher extends StompBrokerRelayMessageHandlerIntegrationTests . StompFrameMessageMatcher { private final String subscriptionId ; private final String destination ; private final Object payload ; public StompMessageFrameMessageMatcher ( String sessionId , String subscriptionId , String destination , Object payload ) { } @ Override protected boolean matchInternal ( StompHeaderAccessor headers , Object payload ) { } @ Override public String toString ( ) { } protected String getPayloadAsText ( ) { } } private static class StompConnectedFrameMessageMatcher extends StompBrokerRelayMessageHandlerIntegrationTests . StompFrameMessageMatcher { public StompConnectedFrameMessageMatcher ( String sessionId ) { } } private static class ExpectationMatchingEventPublisher implements ApplicationEventPublisher { private final List < Boolean > expected = new ArrayList < > ( ) ; private final List < Boolean > actual = new ArrayList < > ( ) ; private final Object monitor = new Object ( ) ; public void expect ( Boolean ... expected ) { } public void awaitAndAssert ( ) throws InterruptedException { } @ Override public void publishEvent ( ApplicationEvent event ) { } } }

Fix:
StompHeaderAccessor headers = StompHeaderAccessor . create ( SEND ) ;