private static void restartOnMac(List<String> beforeRestart, List<String> args) throws IOException {
    var appDir = ourStarter.getValue();
    if (appDir == null) throw new IOException("Application bundle not found: " + PathManager.getHomePath());
    var command = prepareCommand(beforeRestart);
    
    var runProcessCommand = new ArrayList<String>();
    runProcessCommand.add("/usr/bin/open");

    /* JetBrains Client process may be started from the same bundle as the full IDE, so we need to force 'open' command to run a new 
       process from that bundle instead of focusing on the existing application if it's running */
    runProcessCommand.add("-n");
    
    runProcessCommand.add(appDir.toString());
    if (!args.isEmpty()) {
      runProcessCommand.add("--args");
      runProcessCommand.addAll(args);
    }

    command.add(String.valueOf(runProcessCommand.size()));
    command.addAll(runProcessCommand);
    runRestarter(command);
  }
private static void restartOnMac(List<String> beforeRestart, List<String> args)