@Override
  public PsiElement @Nullable [] adjustForMove(@NotNull final Project project,
                                               PsiElement @NotNull [] sourceElements,
                                               @Nullable final PsiElement targetElement) {
    sourceElements = super.adjustForMove(project, sourceElements, targetElement);
    if (sourceElements == null) return null;

    final Set<PsiFile> relatedFilesToMove = new HashSet<>();

    for (PsiElement element : sourceElements) {
      if (!(element instanceof PsiFile)) continue;

      final VirtualFile file = ((PsiFile)element).getVirtualFile();
      if (file == null) continue;

      final Collection<NestingTreeStructureProvider.ChildFileInfo> relatedFileInfos =
        NestingTreeStructureProvider.getFilesShownAsChildrenInProjectView(element.getProject(), file);

      for (NestingTreeStructureProvider.ChildFileInfo info : relatedFileInfos) {
        final PsiFile psiFile = element.getManager().findFile(info.file());
        if (psiFile != null && !ArrayUtil.contains(psiFile, sourceElements)) {
          relatedFilesToMove.add(psiFile);
        }
      }
    }

    if (!relatedFilesToMove.isEmpty()) {
      final String message = relatedFilesToMove.size() == 1
                             ? RefactoringBundle.message("ask.to.move.related.file", relatedFilesToMove.iterator().next().getName())
                             : RefactoringBundle.message("ask.to.move.related.files",
                                                         StringUtil.join(relatedFilesToMove, PsiFile::getName, ", "));
      final int ok = ApplicationManager.getApplication().isUnitTestMode()
                     ? Messages.YES
                     : Messages.showYesNoDialog(project, message, RefactoringBundle.message("move.title"), Messages.getQuestionIcon());
      if (ok == Messages.YES) {
        final PsiElement[] result = Arrays.copyOf(sourceElements, sourceElements.length + relatedFilesToMove.size());
        ArrayUtil.copy(relatedFilesToMove, result, sourceElements.length);

        return result;
      }
    }

    return sourceElements;
  }
@Override
  public PsiElement @Nullable [] adjustForMove(@NotNull final Project project,
                                               PsiElement @NotNull [] sourceElements,
                                               @Nullable final PsiElement targetElement)