ModCommand (@NotNull ActionContext context, @NotNull PsiIdentifier startElement) { PsiClass psiClass = PsiTreeUtil.getParentOfType(startElement, PsiClass.class); if (psiClass == null) return ModCommand.nop(); PsiJavaFile psiJavaFile = tryCast(psiClass.getContainingFile(), PsiJavaFile.class); if (psiJavaFile == null) return ModCommand.nop(); Set<PsiClass> permittedClasses = ContainerUtil.map2Set(psiClass.getPermitsListTypes(), PsiClassType::resolve); return getMissingInheritors(psiJavaFile, psiClass, permittedClasses); }