void () { TestNode nA = new TestNode("A"); TestNode nB = new TestNode("B"); TestNode nC = new TestNode("C"); TestNode nD = new TestNode("D"); TestNode[] allNodes = {nA, nB, nC, nD}; Map<TestNode, TestNode[]> map = new HashMap<>(); map.put(nA, new TestNode[0]); map.put(nB, new TestNode[0]); map.put(nC, new TestNode[]{nA, nB, nD}); map.put(nD, new TestNode[]{nC, nB}); checkCircularDependencyDetected(allNodes, map); }