boolean (PsiElement[] elements, @Nullable PsiElement targetContainer, @Nullable PsiReference reference) { for (PsiElement element : elements) { if (!isPackageOrDirectory(element) && invalid4Move(element)) return false; } if (isReferenceInAnonymousClass(reference)) return false; return targetContainer == null || super.canMove(elements, targetContainer, reference); }