### Question:
JCommanderRunner { public void run(String... args) { boolean success = parse(args); if (!success || needsHelp()) { printUsage(); return; } app.run(); }  static JCommanderRunnerBuilder create(Application app); void run(String... args);  }### Answer:
@Test public void testRunWithHelp() { TestApplication app = new TestApplication(); JCommanderRunner runner = createRunner(app); runner.run("--help"); assertThat(app.ran).isFalse(); }
@Test public void testRunWithRequired() { TestApplication app = new TestApplication(); JCommanderRunner runner = createRunner(app); runner.run("-r"); assertThat(app.ran).isTrue(); }
@Test public void testRunWithoutRequired() { TestApplication app = new TestApplication(); JCommanderRunner runner = createRunner(app); runner.run(); assertThat(app.ran).isFalse(); }