PsiElement (final Object userObject) { if (userObject instanceof TodoPackageNode descriptor) { final PackageElement packageElement = descriptor.getValue(); return packageElement != null ? packageElement.getPackage() : null; } return super.getSelectedElement(userObject); }