### Question:
StatisticDataCollectionHelper { public static void collectAggregatedParents(List<MessageContext> messages, MessageContext newCtx) { if (RuntimeStatisticCollector.isStatisticsEnabled()) { List<Integer> aggregateParents = new LinkedList<>(); for (MessageContext synCtx : messages) { if (RuntimeStatisticCollector.shouldReportStatistic(synCtx)) { aggregateParents.add(StatisticDataCollectionHelper.getParentFlowPosition(synCtx, null)); } } newCtx.setProperty(StatisticsConstants.MEDIATION_FLOW_STATISTICS_PARENT_LIST, aggregateParents); } }  static String getStatisticTraceId(MessageContext messageContext); static int getFlowPosition(MessageContext messageContext); static int getParentFlowPosition(MessageContext messageContext, Integer newParentIndex); static List<Integer> getParentList(MessageContext messageContext); static boolean isOutOnlyFlow(MessageContext messageContext); static void collectData(MessageContext messageContext, boolean isContentAltering,
	                               Boolean isCollectingTracing, StatisticDataUnit statisticDataUnit); static void collectAggregatedParents(List<MessageContext> messages, MessageContext newCtx);  }### Answer:
@Test public void testCollectAggregatedParents() { PowerMockito.mockStatic(RuntimeStatisticCollector.class); PowerMockito.when(RuntimeStatisticCollector.isStatisticsEnabled()).thenReturn(true); PowerMockito.when(RuntimeStatisticCollector.shouldReportStatistic(any(MessageContext.class))).thenReturn(true); messageContextOld.setProperty(StatisticsConstants.MEDIATION_FLOW_STATISTICS_PARENT_INDEX, 1); messageContextNew.setProperty(StatisticsConstants.MEDIATION_FLOW_STATISTICS_PARENT_INDEX, 2); List<MessageContext> messageList = new ArrayList<>(); messageList.add(messageContextOld); StatisticDataCollectionHelper.collectAggregatedParents(messageList, messageContextNew); List<Integer> parentList = Arrays.asList(1); Assert.assertEquals("should return all the parent indices in message list", parentList, messageContextNew .getProperty(StatisticsConstants.MEDIATION_FLOW_STATISTICS_PARENT_LIST)); }