### Question:
DagHelper { public static DAG<String, TaskNode, TaskNodeRelation> buildDagGraph(ProcessDag processDag) { DAG<String,TaskNode,TaskNodeRelation> dag = new DAG<>(); if (CollectionUtils.isNotEmpty(processDag.getNodes())){ for (TaskNode node : processDag.getNodes()){ dag.addNode(node.getName(),node); } } if (CollectionUtils.isNotEmpty(processDag.getEdges())){ for (TaskNodeRelation edge : processDag.getEdges()){ dag.addEdge(edge.getStartNode(),edge.getEndNode()); } } return dag; }  static List<TaskNodeRelation> generateRelationListByFlowNodes(List<TaskNode> taskNodeList); static List<TaskNode> generateFlowNodeListByStartNode(List<TaskNode> taskNodeList, List<String> startNodeNameList,
                                                                 List<String> recoveryNodeNameList, TaskDependType taskDependType); static ProcessDag generateFlowDag(String processDefinitionJson,
                                             List<String> startNodeNameList,
                                             List<String> recoveryNodeNameList,
                                             TaskDependType depNodeType); static Map<String, TaskNode> getForbiddenTaskNodeMaps(String processDefinitionJson); static TaskNode findNodeByName(List<TaskNode> nodeDetails, String nodeName); static Collection<String> getStartVertex(String parentNodeName, DAG<String, TaskNode, TaskNodeRelation> dag,
                                                    Map<String, TaskInstance> completeTaskList); static boolean taskNodeCanSubmit(TaskNode taskNode,
                                            DAG<String, TaskNode, TaskNodeRelation> dag,
                                            Map<String, TaskInstance> completeTaskList); static DAG<String, TaskNode, TaskNodeRelation> buildDagGraph(ProcessDag processDag); static ProcessDag getProcessDag(List<TaskNode> taskNodeList); static boolean haveConditionsAfterNode(String parentNodeName,
                                                  DAG<String, TaskNode, TaskNodeRelation> dag
    ); static boolean haveConditionsAfterNode(String parentNodeName,
                                                  List<TaskNode> taskNodes
    );  }### Answer:
@Test public void testBuildDagGraph() { String shellJson = "{\"globalParams\":[],\"tasks\":[{\"type\":\"SHELL\",\"id\":\"tasks-9527\",\"name\":\"shell-1\"," + "\"params\":{\"resourceList\":[],\"localParams\":[],\"rawScript\":\"#!/bin/bash\\necho \\\"shell-1\\\"\"}," + "\"description\":\"\",\"runFlag\":\"NORMAL\",\"dependence\":{},\"maxRetryTimes\":\"0\",\"retryInterval\":\"1\"," + "\"timeout\":{\"strategy\":\"\",\"interval\":1,\"enable\":false},\"taskInstancePriority\":\"MEDIUM\"," + "\"workerGroupId\":-1,\"preTasks\":[]}],\"tenantId\":1,\"timeout\":0}"; ProcessData processData = JSONUtils.parseObject(shellJson, ProcessData.class); assert processData != null; List<TaskNode> taskNodeList = processData.getTasks(); ProcessDag processDag = DagHelper.getProcessDag(taskNodeList); DAG<String, TaskNode, TaskNodeRelation> dag = DagHelper.buildDagGraph(processDag); Assert.assertNotNull(dag); }