boolean (PsiElement[] elements, @Nullable PsiElement targetContainer, @Nullable PsiReference reference) { for (PsiElement element : elements) { boolean anonymous = element instanceof PsiAnonymousClass; boolean local = element instanceof PsiClass cls && PsiUtil.isLocalClass(cls); if (!anonymous && !local) return false; } return targetContainer == null || super.canMove(elements, targetContainer, reference); }