List<Integer> bfs(Map<TreeNode, Set<TreeNode>> map, TreeNode src, int k) {
        Queue<TreeNode> q = new LinkedList<>();
        q.add(src);
        Set<TreeNode> visited = new HashSet<>();
        int count = 1;
        while (!q.isEmpty()) {
            TreeNode current = q.remove();
            count--;
            //System.out.println(current.val);
            visited.add(current);
            if (map.get(current) != null)
                for (TreeNode nei : map.get(current)) {
                    if (!visited.contains(nei)) {
                        q.add(nei);
                    }
                }
            if (count == 0) {
                k--;
                count += q.size();
            }
            if (k == 0) {
                return q.stream().filter(e -> e != null).map(e -> e.val).collect(Collectors.toList());
            }
        }
        return new ArrayList<>();
    }
Why Did you create this class? what does it do?
src/problems/medium/AllNodesDistanceKinBinaryTree.java