boolean (@Nullable PsiElement o1, @Nullable PsiElement o2) { if (o1 instanceof PsiNamedElement && o2 instanceof PsiNamedElement) { return Objects.equals(((PsiNamedElement)o1).getName(), ((PsiNamedElement)o2).getName()); } return Objects.equals(o1, o2); }