### Question:
CommandPath { public static int launch(Path command, List<String> arguments, Path workingDir, Map<String, String> env) { return new BasicCommandLauncher(workingDir, env).launch(command, arguments); } CommandPath(List<? extends Path> directories); CommandPath append(CommandPath other); static CommandPath system(); static CommandPath of(String pathString); Optional<Path> find(String command); String asPathString(); static int launch(Path command, List<String> arguments, Path workingDir, Map<String, String> env); @Override String toString();  }### Answer:
@Test public void linux_sh() { 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 windows_cmd() throws Exception { Path cmd = assumeWindowsCmd(); Path base = temporary.getRoot().toPath(); Path data = base.resolve("data"); Files.write(data, Arrays.asList("Hello, world!")); int exit = launcher().launch(cmd, "/c", "copy data result"); assertThat(exit, is(0)); assertThat(Files.exists(temporary.getRoot().toPath().resolve("result")), is(true)); }