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