public List<Integer> eventualSafeNodes(int[][] graph) {
        if (graph == null || graph.length == 0)
            return new ArrayList<>();
        int[] cycles = new int[graph.length];
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < graph.length; i++) {
            if (!checkCycle(i, graph, cycles)) {
                list.add(i);
            }
        }
        return list;
    }
Why Did you create this class? what does it do?
src/problems/medium/FindEventualSafeStates.java