### Question:
DagHelper { public static boolean taskNodeCanSubmit(TaskNode taskNode, DAG<String, TaskNode, TaskNodeRelation> dag, Map<String, TaskInstance> completeTaskList) { List<String> dependList = taskNode.getDepList(); if(dependList == null){ return true; } for(String dependNodeName : dependList){ TaskNode dependNode = dag.getNode(dependNodeName); if(!dependNode.isForbidden() && !completeTaskList.containsKey(dependNodeName)){ return false; } } return true; }  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 testTaskNodeCanSubmit() throws JsonProcessingException { DAG<String, TaskNode, TaskNodeRelation> dag = generateDag(); TaskNode taskNode3 = dag.getNode("3"); Map<String, TaskInstance > completeTaskList = new HashMap<>(); completeTaskList.putIfAbsent("1", new TaskInstance()); Boolean canSubmit = false; TaskNode node2 = dag.getNode("2"); node2.setRunFlag(Constants.FLOWNODE_RUN_FLAG_FORBIDDEN); TaskNode nodex = dag.getNode("4"); nodex.setRunFlag(Constants.FLOWNODE_RUN_FLAG_FORBIDDEN); canSubmit = DagHelper.taskNodeCanSubmit(taskNode3, dag, completeTaskList); Assert.assertEquals(canSubmit, true); completeTaskList.putIfAbsent("2", new TaskInstance()); TaskNode nodey = dag.getNode("4"); nodey.setRunFlag(""); canSubmit = DagHelper.taskNodeCanSubmit(taskNode3, dag, completeTaskList); Assert.assertEquals(canSubmit, false); TaskNode node3 = dag.getNode("3"); node3.setRunFlag(Constants.FLOWNODE_RUN_FLAG_FORBIDDEN); TaskNode node5 = dag.getNode("5"); canSubmit = DagHelper.taskNodeCanSubmit(node5, dag, completeTaskList); Assert.assertEquals(canSubmit, true); }