PsiClass (final PsiClass classToMove, final PsiClass newClass, final PsiClass innerClass) { if (classToMove == innerClass) { return newClass; } PsiClass parentClass = findMatchingClass(classToMove, newClass, innerClass.getContainingClass()); PsiClass newInnerClass = parentClass.findInnerClassByName(innerClass.getName(), false); assert newInnerClass != null; return newInnerClass; }