PsiClass (@NotNull PsiElement psiElement) { PsiClass psiClass = PsiTreeUtil.getParentOfType(psiElement, PsiClass.class); if (psiClass == null) return null; return !psiClass.isEnum() && SerializationUtils.isSerializable(psiClass) ? psiClass : null; }