code: public String call(
        List<String> command,
        @Nullable Path workingDirectory,
        @Nullable Map<String, String> environment)
        throws CommandExitException, CommandExecutionException, InterruptedException {
      ProcessExecutor processExecutor = processExecutorFactory.newProcessExecutor();
  
      AsyncStreamSaver stdOutSaver = streamSaverFactory.newSaver();
      AsyncStreamSaver stdErrSaver = streamSaverFactory.newSaver();
  
      try {
        int exitCode =
            processExecutor.run(command, workingDirectory, environment, stdOutSaver, stdErrSaver);
        if (exitCode != 0) {
          String stdOut;
          String stdErr;
          try {
            stdOut = stdOutSaver.getResult().get();
          } catch (InterruptedException ignored) {
            stdOut = "stdout collection interrupted";
          }
          try {
            stdErr = stdErrSaver.getResult().get();
          } catch (InterruptedException ignored) {
            stdErr = "stderr collection interrupted";
          }
          throw new CommandExitException(exitCode, stdOut + "\n" + stdErr);
        }
        return stdOutSaver.getResult().get();
      } catch (IOException | ExecutionException ex) {
        throw new CommandExecutionException(ex);
      }
    }
docs: Runs the command and returns process's stdout stream as a string.