private static Integer solve2(List<String> list) {
        if (list == null || list.isEmpty())
            return 0;

        Map<String, Integer> map = new HashMap<>();

        for (int i = 0; i < list.size(); i++) {
            String s = list.get(i);
            String[] a = s.split(" ");
            map.put(a[0], Integer.parseInt(a[1].substring(1, a[1].length() - 1)));
        }

        Map<String, Set<String>> tree = new HashMap<>();

        for (int i = 0; i < list.size(); i++) {
            String s = list.get(i);
            String[] a = s.split(" ");
            if (!tree.containsKey(a[0]))
                tree.put(a[0], new HashSet<>());
            for (int j = 3; j < a.length; j++) {
                String child = a[j];
                if (child.endsWith(","))
                    child = a[j].substring(0, a[j].length() - 1);
                tree.get(a[0]).add(child);
            }
        }
        String root = solve(list);
        go(tree, root, map);
        return res;
    }
Why Did you create this class? what does it do?
src/adventofcode/RecursiveCircus.java