### Question:
TracingDataCollectionHelper { public static Map<String, Object> extractContextProperties(MessageContext synCtx) { Set<String> propertySet = synCtx.getPropertyKeySet(); Map<String, Object> propertyMap = new TreeMap<>(); for (String property : propertySet) { Object propertyValue = synCtx.getProperty(property); propertyMap.put(property, propertyValue); } propertyMap.remove(SynapseConstants.STATISTICS_STACK); propertyMap.remove(StatisticsConstants.STAT_COLLECTOR_PROPERTY); return propertyMap; }  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 testExtractContextProperties() throws Exception { messageContext.setProperty("testProp", "testValue"); messageContext.setProperty(SynapseConstants.STATISTICS_STACK, "value2"); messageContext.setProperty(StatisticsConstants.STAT_COLLECTOR_PROPERTY, "value3"); Map<String, Object> tempMap = TracingDataCollectionHelper.extractContextProperties(messageContext); Assert.assertNull("value should be removed from the map", tempMap.get(SynapseConstants.STATISTICS_STACK)); Assert.assertNull("value should be removed from the map", tempMap.get(StatisticsConstants.STAT_COLLECTOR_PROPERTY)); Assert.assertEquals("remaining entry should be in the map", 1, tempMap.size()); }