List<PsiClass> (PsiElement element) { final List<PsiClass> targetClasses = new ArrayList<>(); for (PsiClass psiClass : super.getTargetClasses(element)) { if (canModify(psiClass) && (!psiClass.isInterface() && !psiClass.isAnnotationType() && !psiClass.isRecord() || shouldCreateStaticMember(myReferenceExpression, psiClass))) { PsiElement target = myReferenceExpression.resolve(); if (!(target instanceof PsiField field) || field.getContainingClass() != psiClass) { targetClasses.add(psiClass); } } } return targetClasses; }