@VisibleForTesting
  static Function<List<String>, ProcessBuilder> defaultProcessBuilderFactory(
      String dockerExecutable, ImmutableMap<String, String> dockerEnvironment) {
    return dockerSubCommand -> {
      List<String> dockerCommand = new ArrayList<>(1 + dockerSubCommand.size());
      dockerCommand.add(dockerExecutable);
      dockerCommand.addAll(dockerSubCommand);

      ProcessBuilder processBuilder = new ProcessBuilder(dockerCommand);
      Map<String, String> environment = processBuilder.environment();
      environment.putAll(dockerEnvironment);

      return processBuilder;
    };
  }
@Test
  public void testDefaultProcessorBuilderFactory_customExecutable() {
    ProcessBuilder processBuilder =
        CliDockerClient.defaultProcessBuilderFactory("docker-executable", ImmutableMap.of())
            .apply(Arrays.asList("sub", "command"));

    Assert.assertEquals(
        Arrays.asList("docker-executable", "sub", "command"), processBuilder.command());
    Assert.assertEquals(System.getenv(), processBuilder.environment());
  }