### Question:
TraceeMessageProducer implements MessageProducer { protected void writeTraceeContextToMessage(Message message) throws JMSException { if (!backend.isEmpty() && backend.getConfiguration().shouldProcessContext(AsyncDispatch)) { final Map<String, String> filteredContext = backend.getConfiguration().filterDeniedParams(backend.copyToMap(), AsyncDispatch); final String contextAsString = httpHeaderSerialization.render(filteredContext); message.setStringProperty(TraceeConstants.TPIC_HEADER, contextAsString); } } TraceeMessageProducer(MessageProducer delegate, TraceeBackend backend);  TraceeMessageProducer(MessageProducer delegate); @Override void send(Message message); @Override void send(Message message, int deliveryMode, int priority, long timeToLive); @Override void send(Destination destination, Message message); @Override void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive); @Override void setDisableMessageID(boolean value); @Override boolean getDisableMessageID(); @Override void setDisableMessageTimestamp(boolean value); @Override boolean getDisableMessageTimestamp(); @Override void setDeliveryMode(int deliveryMode); @Override int getDeliveryMode(); @Override void setPriority(int defaultPriority); @Override int getPriority(); @Override void setTimeToLive(long timeToLive); @Override long getTimeToLive(); @Override Destination getDestination(); @Override void close();  }### Answer:
@Test public void testWriteTraceeContextToMessage() throws Exception { backend.put("random", "entry"); unit.writeTraceeContextToMessage(message); final String renderedTpic = httpHeaderTransport.render(Collections.singletonMap("random", "entry")); verify(message).setStringProperty(eq(TraceeConstants.TPIC_HEADER), eq(renderedTpic)); }
@Test public void testDontWriteEmptyTraceeContextToMessage() throws Exception { backend.clear(); unit.writeTraceeContextToMessage(message); verifyNoMoreInteractions(message); }