boolean (@NotNull TreeNode node) { if (!myTree.isRootVisible() && getRootNode() == node) return false; if (isLoadingNode(node)) return true; Object elementInTree = getElementFor(node); if (elementInTree == null) return false; TreeNode parentNode = node.getParent(); Object parentElementInTree = getElementFor(parentNode); if (parentElementInTree == null) return false; Object parentElement = getTreeStructure().getParentElement(elementInTree); return parentElementInTree.equals(parentElement); }