code: public static boolean isWindowsProcessAlive(InstanceConfiguration config, String pid)
      {
          CommandLine command = new CommandLine("tasklist")
                  .addArgument("/FI")
                  .addArgument("PID eq " + pid, true);
          List<String> output = executeScript(config, command, true);
          
          String keyword = String.format(" %s ", pid);
          boolean isRunning = output.stream().anyMatch(s -> s.contains(keyword));
  
          return isRunning;
      }
docs: Check if the process with the given PID is running or not.
  This method only handles processes running on Windows.
  @param config - the instance config
  @param pid the process ID
  @return true if the process is running, false otherwise