@VisibleForTesting
  Process execute() throws IOException, InterruptedException, ExecutionException {
    // Nmap is a long running process and the collectStream method is a blocking method.
    // By default CompletableFuture uses ForkJoinPool, which is for suitable short
    // non-blocking operations.
    Executor executor = Executors.newCachedThreadPool();
    return execute(executor);
  }
@Test
  public void execute_always_startsProcessAndReturnsProcessInstance()
      throws IOException, InterruptedException, ExecutionException {
    CommandExecutor executor = new CommandExecutor("/bin/sh", "-c", "echo 1");

    Process process = executor.execute();
    process.waitFor();

    assertThat(process.exitValue()).isEqualTo(0);
  }