code: @VisibleForTesting
      Task createDynamicForkTask(WorkflowTask taskToSchedule, Workflow workflowInstance, String taskId, List<WorkflowTask> dynForkTasks) {
          Task forkDynamicTask = new Task();
          forkDynamicTask.setTaskType(SystemTaskType.FORK.name());
          forkDynamicTask.setTaskDefName(SystemTaskType.FORK.name());
          forkDynamicTask.setReferenceTaskName(taskToSchedule.getTaskReferenceName());
          forkDynamicTask.setWorkflowInstanceId(workflowInstance.getWorkflowId());
          forkDynamicTask.setCorrelationId(workflowInstance.getCorrelationId());
          forkDynamicTask.setScheduledTime(System.currentTimeMillis());
          forkDynamicTask.setEndTime(System.currentTimeMillis());
          List<String> forkedTaskNames = dynForkTasks.stream()
                  .map(WorkflowTask::getTaskReferenceName)
                  .collect(Collectors.toList());
          forkDynamicTask.getInputData().put("forkedTasks", forkedTaskNames);
          forkDynamicTask.getInputData().put("forkedTaskDefs", dynForkTasks);    //TODO: Remove this parameter in the later releases
          forkDynamicTask.setTaskId(taskId);
          forkDynamicTask.setStatus(Task.Status.COMPLETED);
          forkDynamicTask.setWorkflowTask(taskToSchedule);
          return forkDynamicTask;
      }
docs: This method creates a FORK task and adds the list of dynamic fork tasks keyed by "forkedTaskDefs" and
  their names keyed by "forkedTasks" into {@link Task#getInputData()}
  
  @param taskToSchedule    A {@link WorkflowTask} representing {@link TaskType#FORK_JOIN_DYNAMIC}
  @param workflowInstance: A instance of the {@link Workflow} which represents the workflow being executed.
  @param taskId:           The string representation of {@link java.util.UUID} which will be set as the taskId.
  @param dynForkTasks:     The list of dynamic forked tasks, the reference names of these tasks will be added to the forkDynamicTask
  @return A new instance of {@link Task} representing a {@link SystemTaskType#FORK}