### Question:
TracingDataCollectionHelper { public static Map<String, Object> extractTransportProperties(MessageContext synCtx) { Map<String, Object> transportPropertyMap = new TreeMap<>(); Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx; org.apache.axis2.context.MessageContext axis2MessageCtx = axis2smc.getAxis2MessageContext(); Object headers = axis2MessageCtx.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS); if (headers != null && headers instanceof Map) { Map headersMap = (Map) headers; Set<String> axis2PropertySet = headersMap.keySet(); for (String entry : axis2PropertySet) { transportPropertyMap.put(entry, headersMap.get(entry)); } } if (axis2MessageCtx.getTo() != null) { transportPropertyMap.put(SynapseConstants.HEADER_TO, axis2MessageCtx.getTo().getAddress()); } if (axis2MessageCtx.getFrom() != null) { transportPropertyMap.put(SynapseConstants.HEADER_FROM, axis2MessageCtx.getFrom().getAddress()); } if (axis2MessageCtx.getWSAAction() != null) { transportPropertyMap.put("WSAction", axis2MessageCtx.getWSAAction()); } if (axis2MessageCtx.getSoapAction() != null) { transportPropertyMap.put("SOAPAction", axis2MessageCtx.getSoapAction()); } if (axis2MessageCtx.getReplyTo() != null) { transportPropertyMap.put(SynapseConstants.HEADER_REPLY_TO, axis2MessageCtx.getReplyTo().getAddress()); } if (axis2MessageCtx.getMessageID() != null) { transportPropertyMap.put(SynapseConstants.HEADER_MESSAGE_ID, axis2MessageCtx.getMessageID()); } if (transportPropertyMap.get("Cookie") != null) { transportPropertyMap.remove("Cookie"); } return transportPropertyMap; }  static String collectPayload(MessageContext messageContext); static Map<String, Object> extractContextProperties(MessageContext synCtx); static Map<String, Object> extractTransportProperties(MessageContext synCtx); static PublishingFlow createPublishingFlow(List<StatisticsLog> messageFlowLogs);  }### Answer:
@Test public void testExtractTransportProperties() { String Cookie = "Cookie"; Map<String, Object> propertyMap = new HashMap<>(); propertyMap.put(Cookie, "testCookie"); propertyMap.put("Random", "RandomValue"); messageContext.getAxis2MessageContext().setProperty(org.apache .axis2.context.MessageContext.TRANSPORT_HEADERS, propertyMap); EndpointReference endpointReferenceTO = new EndpointReference(); endpointReferenceTO.setAddress("testAddressTo"); EndpointReference endpointReferenceFrom = new EndpointReference(); endpointReferenceFrom.setAddress("testAddressFrom"); EndpointReference endpointReferenceReplyTo = new EndpointReference(); endpointReferenceReplyTo.setAddress("testAddressReplyTo"); messageContext.setTo(endpointReferenceTO); messageContext.setFrom(endpointReferenceFrom); messageContext.setWSAAction("testWSAAction"); messageContext.setSoapAction("testSoapAction"); messageContext.setReplyTo(endpointReferenceReplyTo); messageContext.setMessageID("1234"); Map<String, Object> tempMap = TracingDataCollectionHelper.extractTransportProperties(messageContext); Assert.assertNull("cookies should be removed", tempMap.get(Cookie)); Assert.assertEquals("all the properties other than cookies should be inserted to the map", 7, tempMap.size()); }