public static Set<String> computeStepIdsInRuntimeDag(
      @NotNull WorkflowInstance instance, @NotNull Set<String> knownStepIds) {
    if (instance.isFreshRun()
        || instance.getRunConfig() == null
        || instance.getRunConfig().getPolicy() != RunPolicy.RESTART_FROM_SPECIFIC) {
      return instance.getRuntimeDag().keySet();
    }

    Map<String, Set<String>> childMap = new HashMap<>();
    prepareDagForTraversal(
        instance.getRuntimeDag(),
        knownStepIds,
        instance.getRunConfig().getRestartConfig(),
        new HashMap<>(),
        childMap);

    return childMap.keySet();
  }
@Test
  public void testComputeStepIdsInRuntimeDagForStart() {
    WorkflowInstance instance = new WorkflowInstance();
    instance.setRuntimeDag(runtimeDag2);
    Set<String> actual = DagHelper.computeStepIdsInRuntimeDag(instance, Collections.emptySet());
    Assert.assertEquals("[job_1, job_3, job_2, job_5, job_4]", actual.toString());
  }