@Override
  public boolean move(PsiFile file,
                      PsiDirectory moveDestination,
                      Map<PsiElement, PsiElement> oldToNewElementsMapping,
                      List<? super PsiFile> movedFiles,
                      RefactoringElementListener listener) {
    if (!(file instanceof PsiJavaFile javaFile)) {
      return false;
    }

    final PsiClass[] classes = javaFile.getClasses();
    if (classes.length == 0) {
      return false;
    }

    if (FileTypeUtils.isInServerPageFile(file)) {
      return false;
    }

    for (PsiClass psiClass : classes) {
      final PsiClass newClass = MoveClassesOrPackagesUtil.doMoveClass(psiClass, moveDestination);
      oldToNewElementsMapping.put(psiClass, newClass);
      listener.elementMoved(newClass);
    }
    return true;
  }
@Override
  public boolean move(PsiFile file,
                      PsiDirectory moveDestination,
                      Map<PsiElement, PsiElement> oldToNewElementsMapping,
                      List<? super PsiFile> movedFiles,
                      RefactoringElementListener listener)