boolean (Object obj) { if (!(obj instanceof PsiElement psiElement)) return true; for (NavBarModelExtension modelExtension : NavBarModelExtension.EP_NAME.getExtensionList()) { Boolean expand = modelExtension.shouldExpandOnClick(psiElement); if (expand != null) return expand; } return psiElement instanceof PsiDirectory || psiElement instanceof PsiDirectoryContainer; }