public List<Integer> getSCC(Graph graph, Graph reversedGraph) {
        List<Integer> result = new ArrayList<Integer>();


        System.out.println("Start sorting");
        Stack<Vertex<T>> dfsSorting = getDfsSorting(graph);
        System.out.println("End sorting");


        Stack<Vertex<T>> stack = new Stack<Vertex<T>>();

        while (!dfsSorting.isEmpty()) {
            stack.push(reversedGraph.getVertex(dfsSorting.pop()));
            Set<Vertex<T>> scc = new HashSet<Vertex<T>>();

            while (!stack.isEmpty()) {
                Vertex<T> vertex = stack.pop();
                scc.add(vertex);

                for (Edge<T> edge : vertex.getEdges()) {
                    if (!scc.contains(edge.getVertex2()) && dfsSorting.contains(edge.getVertex2())) {
                        stack.push(edge.getVertex2());
                    }

                }
            }

            //remove all visited nodes
            dfsSorting.removeAll(scc);
            result.add(scc.size());
        }
        return result;
    }