boolean (PsiReferenceExpression expression) { if (!"equals".equals(expression.getReferenceName())) { return false; } final PsiElement target = expression.resolve(); if (!(target instanceof PsiMethod method)) { return false; } final PsiClass aClass = method.getContainingClass(); return aClass != null && CommonClassNames.JAVA_LANG_STRING.equals(aClass.getQualifiedName()); }