private static List<String> prepareCommand(List<String> beforeRestart) throws IOException {
    var restarter = Path.of(PathManager.getBinPath(), SystemInfo.isWindows ? "restarter.exe" : "restarter");
    var command = new ArrayList<String>();
    command.add(copyWhenNeeded(restarter, beforeRestart).toString());
    command.add(String.valueOf(ProcessHandle.current().pid()));
    if (!beforeRestart.isEmpty()) {
      command.add(String.valueOf(beforeRestart.size()));
      command.addAll(beforeRestart);
    }
    return command;
  }
private static List<String> prepareCommand(List<String> beforeRestart)