boolean (@NotNull NodeDescriptor<?> descriptor, boolean validate) { if (isAlwaysExpandedTree()) return false; boolean autoExpand = getBuilder().isAutoExpandNode(descriptor); Object element = getElementFromDescriptor(descriptor); if (validate && element != null) { autoExpand = validateAutoExpand(autoExpand, element); } if (!autoExpand && !myTree.isRootVisible()) { if (element != null && element.equals(getTreeStructure().getRootElement())) return true; } return autoExpand; }