public static Set<String> getNotCreatedRootNodesInRestartRuntimeDag(
      @NotNull Map<String, StepTransition> runtimeDag, @NotNull RestartConfig restartConfig) {
    Set<String> rootStepIds =
        runtimeDag.entrySet().stream()
            .filter(entry -> entry.getValue().getPredecessors().isEmpty())
            .map(Map.Entry::getKey)
            .collect(Collectors.toSet());
    Optional.ofNullable(RunRequest.getCurrentNode(restartConfig).getStepId())
        .ifPresent(
            stepId ->
                Checks.checkTrue(
                    rootStepIds.remove(stepId),
                    "Invalid state: stepId [%s] should be one of root nodes in the DAG",
                    stepId));
    return rootStepIds;
  }
@Test
  public void testGetNotCreatedRootNodesInRestartRuntimeDagInvalid() {
    RestartConfig config =
        RestartConfig.builder().addRestartNode("sample-dag-test-1", 1, "job_6").build();
    AssertHelper.assertThrows(
        "Invalid status for steps",
        IllegalArgumentException.class,
        "stepId [job_6] should be one of root nodes in the DAG",
        () -> DagHelper.getNotCreatedRootNodesInRestartRuntimeDag(runtimeDag1, config));
  }