private static @Nullable ActionCommand mapPaths(ActionCommand command, Path oldTarget, Path newTarget) {
    if (command instanceof CopyCommand) {
      Path destination = mapPath(((CopyCommand)command).myDestination, oldTarget, newTarget);
      if (destination != null) {
        return new CopyCommand(Paths.get(((CopyCommand)command).mySource), destination);
      }
    }
    else if (command instanceof UnzipCommand unzipCommand) {
      Path destination = mapPath(unzipCommand.myDestination, oldTarget, newTarget);
      if (destination != null) {
        return new UnzipCommand(Path.of(unzipCommand.mySource), destination, unzipCommand.myFilenameFilter);
      }
    }
    else if (command instanceof DeleteCommand) {
      Path source = mapPath(((DeleteCommand)command).mySource, oldTarget, newTarget);
      if (source != null) {
        return new DeleteCommand(source);
      }
    }

    return null;
  }
private static @Nullable ActionCommand mapPaths(ActionCommand command, Path oldTarget, Path newTarget)