code: protected ExecutionEntity processExecutionTree(String rootProcessInstanceId, List<ExecutionEntity> executions) {
      ExecutionEntity rootExecution = null;
      
      // Collect executions
      Map<String, ExecutionEntity> executionMap = new HashMap<String, ExecutionEntity>(executions.size());
      for (ExecutionEntity executionEntity : executions) {
        if (executionEntity.getId().equals(rootProcessInstanceId)) {
          rootExecution = executionEntity;
        }
        executionMap.put(executionEntity.getId(), executionEntity);
      }
      
      // Set relationships
      for (ExecutionEntity executionEntity : executions) {
        
        // Root process instance relationship
        if (executionEntity.getRootProcessInstanceId() != null) {
          executionEntity.setRootProcessInstance(executionMap.get(executionEntity.getRootProcessInstanceId()));
        }
        
        // Process instance relationship
        if (executionEntity.getProcessInstanceId() != null) {
          executionEntity.setProcessInstance(executionMap.get(executionEntity.getProcessInstanceId()));
        }
        
        // Parent - child relationship
        if (executionEntity.getParentId() != null) {
          ExecutionEntity parentExecutionEntity = executionMap.get(executionEntity.getParentId());
          executionEntity.setParent(parentExecutionEntity);
          parentExecutionEntity.addChildExecution(executionEntity);
        }
        
        // Super - sub execution relationship
        if (executionEntity.getSuperExecution() != null) {
          ExecutionEntity superExecutionEntity = executionMap.get(executionEntity.getSuperExecutionId());
          executionEntity.setSuperExecution(superExecutionEntity);
          superExecutionEntity.setSubProcessInstance(executionEntity);
        }
        
      }
      return rootExecution;
    }
docs: Processes a collection of {@link ExecutionEntity} instances, which form on execution tree.
  All the executions share the same rootProcessInstanceId (which is provided).
  The return value will be the root {@link ExecutionEntity} instance, with all child {@link ExecutionEntity}
  instances populated and set using the {@link ExecutionEntity} instances from the provided collections