@Test public void count_givenRandomNodesSize_givenEverySecondConnected_returnsHalf() throws Exception { int times = new Random().nextInt(333) * 2; addNodes(times); LongStream.range(0, times).filter(i -> i % 2 == 0) .forEach(i -> connect((int) i, (int) i + 1)); Assert.assertEquals(times / 2, test.countConnectedComponents(g)); }
public int countConnectedComponents(Graph g) { throw new RuntimeException("Not yet implemented."); }
ConnectedComponents { public int countConnectedComponents(Graph g) { throw new RuntimeException("Not yet implemented."); } }
ConnectedComponents { public int countConnectedComponents(Graph g) { throw new RuntimeException("Not yet implemented."); } ConnectedComponents(); }
ConnectedComponents { public int countConnectedComponents(Graph g) { throw new RuntimeException("Not yet implemented."); } ConnectedComponents(); int countConnectedComponents(Graph g); }
ConnectedComponents { public int countConnectedComponents(Graph g) { throw new RuntimeException("Not yet implemented."); } ConnectedComponents(); int countConnectedComponents(Graph g);  }