<awangdev>Number of Connected Components in an Undirected Graph_2.java
private void dfs(Map<Integer, List<Integer>> graph, boolean[] visited, int i) {

        if (visited[i]) {
            return;
        }
        visited[i] = true;
        for (int j : graph.get(i)) {
            dfs(graph, visited, j);
        }
    }
private void sample_funcname ( Map < Integer , List < Integer >> graph , boolean [ ] visited , int i ) {
  if ( visited [ i ] ) {
    return ;
  }
  visited [ i ] = true ;
  for ( int j : graph . get ( i ) ) {
    dfs ( graph , visited , j ) ;
  }
}
