boolean (@NotNull PsiField field) { if (hasUnsuitableModifiers(field)) return false; // Doesn't work for Groovy if (field.getLanguage() != JavaLanguage.INSTANCE) return false; PsiExpression initializer = field.getInitializer(); if (initializer == null || initializer.getNextSibling() instanceof PsiErrorElement) return false; PsiClass psiClass = field.getContainingClass(); return psiClass != null && !psiClass.isInterface() && !psiClass.isRecord() && !(psiClass instanceof PsiAnonymousClass) && !(psiClass instanceof PsiSyntheticClass); }