docs: protected static boolean isLegacyBehaviorRequired(ActivityExecution scopeExecution) {
      // legacy behavior is turned off: the current activity was parsed as scope.
      // now we need to check whether a scope execution was correctly created for the
      // event subprocess.
  
      // first create the mapping:
      Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping = scopeExecution.createActivityExecutionMapping();
      // if the scope execution for the current activity is the same as for the parent scope
      // -> we need to perform legacy behavior
      PvmScope activity = scopeExecution.getActivity();
      if (!activity.isScope()) {
        activity = activity.getFlowScope();
      }
      return activityExecutionMapping.get(activity) == activityExecutionMapping.get(activity.getFlowScope());
    }