private static @Nullable List<ProcessInfo> parseCommandOutput(@NotNull List<@NlsSafe String> command,
                                                                @NotNull NullableFunction<? super String, ? extends List<ProcessInfo>> parser,
                                                                @Nullable Charset charset) {
    String output;
    try {
      GeneralCommandLine commandLine = new GeneralCommandLine(command);
      if (charset != null)
        commandLine.withCharset(charset);
      ProcessOutput processOutput = ExecUtil.execAndGetOutput(commandLine);
      int exitCode = processOutput.getExitCode();
      if (exitCode != 0) {
        LOG.error("Cannot get process list, command '" + StringUtil.join(command, " ") +"' exited with code " + exitCode + ", stdout:\n"
                  + processOutput.getStdout()
                  + "\nstderr:\n"
                  + processOutput.getStderr());
      }
      output = processOutput.getStdout();
    }
    catch (ExecutionException e) {
      LOG.error("Cannot get process list", e);
      return null;
    }
    return parser.fun(output);
  }
private static @Nullable List<ProcessInfo> parseCommandOutput(@NotNull List<@NlsSafe String> command,
                                                                @NotNull NullableFunction<? super String, ? extends List<ProcessInfo>> parser,
                                                                @Nullable Charset charset)