code: synchronized Process startWorker() throws IOException {
      if (worker == null) {
        final Process delegate = workerBuilder.start();
        final Thread shutdownHook = new Thread("worker-shutdown-hook-" + trialId) {
          @Override public void run() {
            delegate.destroy();
          }
        };
        shutdownHookRegistrar.addShutdownHook(shutdownHook);
        worker = new Process() {
          @Override public OutputStream getOutputStream() {
            return delegate.getOutputStream();
          }
  
          @Override public InputStream getInputStream() {
            return delegate.getInputStream();
          }
  
          @Override public InputStream getErrorStream() {
            return delegate.getErrorStream();
          }
  
          @Override public int waitFor() throws InterruptedException {
            int waitFor = delegate.waitFor();
            shutdownHookRegistrar.removeShutdownHook(shutdownHook);
            return waitFor;
          }
  
          @Override public int exitValue() {
            int exitValue = delegate.exitValue();
            // if it hasn't thrown, the process is done
            shutdownHookRegistrar.removeShutdownHook(shutdownHook);
            return exitValue;
          }
  
          @Override public void destroy() {
            delegate.destroy();
            shutdownHookRegistrar.removeShutdownHook(shutdownHook);
          }
        };
      }
      return worker;
    }
docs: Returns a {@link Process} representing this worker.  The process will be started if it hasn't
  already.