void () { Stack<XValueNodeImpl> nodes = new Stack<>(); XValueNodeImpl parent = (XValueNodeImpl)myTree.getRoot(); nodes.push(parent); while (!nodes.empty()) { XValueNodeImpl node = nodes.pop(); for (TreeNode child : node.getLoadedChildren()) { if (child instanceof XValueNodeImpl childImpl && myHeldObjects.contains(getObjectReference(childImpl))) { myHighlighter.highlightNode(childImpl); nodes.push(childImpl); } } } }