PsiElement (@NotNull PsiFile copy) { PsiElement parent = getParent(); if (parent instanceof PsiClassOwner && copy instanceof PsiClassOwner) { PsiClass[] copyClasses = ((PsiClassOwner)copy).getClasses(); for (PsiClass copyClass : copyClasses) { if (copyClass.isEquivalentTo(this)) { return copyClass; } } } return SyntheticElement.super.findSameElementInCopy(copy); }