class OperationTimeAggregator {

    public ProcessTime computeOverallProcessTime(String correlationId, Map<String, ProcessTime> processTimes) {
        ProcessTime rootProcessTime = processTimes.get(correlationId);

        long overallDelayBetweenSteps = processTimes.values()
                                                    .stream()
                                                    .mapToLong(ProcessTime::getDelayBetweenSteps)
                                                    .sum();

        return ImmutableProcessTime.copyOf(rootProcessTime)
                                   .withDelayBetweenSteps(overallDelayBetweenSteps);
    }

    @Inject public  OperationTimeAggregator(FlowableFacade flowableFacade);

}