void (PsiReference ref) { if (ref == null) return; final PsiElement resolved = ref.resolve(); if (resolved instanceof PsiField field && aClass.equals(field.getContainingClass())) { candidates.remove(field); } }