private boolean checkCycle(int node, int[][] graph, int[] stack) {
        if (stack[node] > 0)
            return stack[node] == 2;
        stack[node] = 2;
        int[] edges = graph[node];
        for (int i = 0; i < edges.length; i++) {
            if (stack[edges[i]] == 2 || checkCycle(edges[i], graph, stack)) {
                return true;
            }
        }
        stack[node] = 1;
        return false;
    }
Why Did you create this class? what does it do?
src/problems/medium/FindEventualSafeStates.java