boolean (PsiField field, UsageInfo[] usages) { for (UsageInfo usage : usages) { if (usage instanceof InternalUsageInfo internalUsageInfo && internalUsageInfo.isInsideAnonymous() && internalUsageInfo.getReferencedElement() instanceof PsiField refField && field.equals(refField)) { return true; } } return false; }