boolean (@NotNull InspectionTreeNode node) { if (node.isExcluded()) { return false; } if (node instanceof RefElementNode refNode) { if (hasDescriptorUnder(refNode)) return false; final RefEntity element = refNode.getElement(); return element != null && element.isValid(); } return node instanceof ProblemDescriptionNode; }