boolean (PsiReference reference) { final PsiElement element = reference.getElement(); final TextRange textRange = getRangeToRename(reference); final String referenceText = textRange.substring(element.getText()); return Comparing.strEqual(referenceText, myElementToRename.getName()); }