private List<Node> findChildren(Node node, int depth) {



        List<Node> result = null;
        List<Node> traversed = new LinkedList<Node>();
        traversed.add(node);

        int count = 0;
        while (!traversed.isEmpty() && (count < depth)) {

            Node tmp = traversed.remove(0);
            count += 1;

            Set<Node> children = tmp.getChildren();

            if (children == null || children.isEmpty()) {

                continue;
            }

            if ((depth - (count + traversed.size())) > 0) {

                depth += children.size() - 1;
            }


            if (result == null) result = new ArrayList<Node>();
            for (Node child : children) {

                if (result.contains(child) == false) {
                    result.add(child);
                    traversed.add(child);
                }
            }


        }



        return result;


    }