@Test
public void showsStacktrace() throws Exception {

    Cli cli = new Cli("mytest");
    PrintStream out = System.out;
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    PrintStream printStream = new PrintStream(outputStream);
    System.setOut(printStream);
    try {
        cli.run(new String[]{"invalid", "--stacktrace"});
        Assertions.fail("Expected to throw");
    } catch (RuntimeException e) {
    }
    System.setOut(out);
    String help = outputStream.toString("UTF-8");
    assertThat(help, containsString("Unknown command or argument"));
}