@Override
  protected @Nullable PsiDirectory getTargetDirectory(DataContext ctx, IdeView view) {
    PsiDirectory[] directories = view.getDirectories();
    if (directories.length == 1) {
      PsiDirectory psiDir = directories[0];
      VirtualFile vDir = psiDir.getVirtualFile();
      ProjectFileIndex index = ProjectRootManager.getInstance(psiDir.getProject()).getFileIndex();
      if (index.isUnderSourceRootOfType(vDir, Set.of(JavaSourceRootType.SOURCE, JavaSourceRootType.TEST_SOURCE))) {
        VirtualFile root = index.getSourceRootForFile(vDir);
        if (root != null) {
          return psiDir.getManager().findDirectory(root);
        }
      }
    }

    return null;
  }
@Override
  protected @Nullable PsiDirectory getTargetDirectory(DataContext ctx, IdeView view)