### Question:
BasicCommandLauncher implements CommandLauncher { @Override public int launch(Path command, List<String> arguments) throws IOException, InterruptedException { List<String> commandLine = new ArrayList<>(); commandLine.add(command.toAbsolutePath().toString()); commandLine.addAll(arguments); ProcessBuilder builder = new ProcessBuilder(commandLine); builder.directory(workingDir.toFile()); builder.environment().clear(); builder.environment().putAll(environment); if (LOG.isInfoEnabled()) { LOG.info("exec: {}", builder.command().stream() .map(it -> '"' + it + '"') .collect(Collectors.joining(", "))); } Process process = builder.start(); try { return handle(process, Optional.ofNullable(command.getFileName()) .map(Path::toString) .orElse("N/A")); } finally { process.destroy(); } } BasicCommandLauncher(Path workingDir, Map<String, String> environment);  BasicCommandLauncher(OutputConsumer output, Path workingDir, Map<String, String> environment); @Override int launch(Path command, List<String> arguments);  }### Answer:
@Test public void simple() throws Exception { Path sh = assumeLinuxSh(); int exit = launcher().launch(sh, "-c", "touch result"); assertThat(exit, is(0)); assertThat(Files.exists(temporary.getRoot().toPath().resolve("result")), is(true)); }
@Test public void echo() throws Exception { Path sh = assumeLinuxSh(); int exit = launcher().launch(sh, "-c", "echo 'Hello, world!'"); assertThat(exit, is(0)); }
@Test public void abend() throws Exception { Path sh = assumeLinuxSh(); int exit = launcher().launch(sh, "-c", "exit 1"); assertThat(exit, is(not(0))); }