code: public ProcessContext to(ProcessBuilder processBuilder) {
      return Optional.ofNullable(processBuilder).map(localProcessBuilder -> {
        localProcessBuilder.command(getCommandLine());
        localProcessBuilder.directory(getDirectory());
        localProcessBuilder.environment().clear();
        localProcessBuilder.environment().putAll(getEnvironment().toMap());
        localProcessBuilder.redirectErrorStream(isRedirectingErrorStream());
  
        Optional.ofNullable(getError()).ifPresent(localProcessBuilder::redirectError);
        Optional.ofNullable(getInput()).ifPresent(localProcessBuilder::redirectInput);
        Optional.ofNullable(getOutput()).ifPresent(localProcessBuilder::redirectOutput);
  
        if (inheritsIO()) {
          processBuilder.inheritIO();
        }
  
        return this;
      }).orElse(this);
    }
docs: Writes the current state of this {@link ProcessContext} to the given {@link ProcessBuilder}.
  
  @param processBuilder {@link ProcessBuilder} to set the state with this {@link ProcessContext}.
  @return this {@link ProcessContext}.
  @see java.lang.ProcessBuilder