### Question:
DAG { public Collection<Node> getEndNode() { lock.readLock().lock(); try{ return CollectionUtils.subtract(nodesMap.keySet(), edgesMap.keySet()); }finally { lock.readLock().unlock(); } } DAG(); void addNode(Node node, NodeInfo nodeInfo); boolean addEdge(Node fromNode, Node toNode); boolean addEdge(Node fromNode, Node toNode, EdgeInfo edge, boolean createNode); boolean containsNode(Node node); boolean containsEdge(Node fromNode, Node toNode); NodeInfo getNode(Node node); int getNodesCount(); int getEdgesCount(); Collection<Node> getBeginNode(); Collection<Node> getEndNode(); Set<Node> getPreviousNodes(Node node); Set<Node> getSubsequentNodes(Node node); int getIndegree(Node node); boolean hasCycle(); List<Node> topologicalSort();  }### Answer:
@Test public void testEndNode() { makeGraph(); assertEquals(graph.getEndNode().size(), 1); assertTrue(graph.getEndNode().contains(7)); }