### Question:
CommandLine { public OptionBuilder newOption() { return new OptionBuilder(options, this); } CommandLine(String motd); OptionBuilder newOption(); Options parse(String[] args); void throwHelp(Option state);  }### Answer:
@Test public void testDontAllowEmptyOptions() throws Exception { expect.expectMessage("un-finished"); commandLine.newOption().done(); }
@Test public void testDontAllowDuplicateOptions() throws Exception { expect.expectMessage("re-called"); CommandLine.OptionBuilder s = commandLine.newOption().shortOption("s"); s.done(); s.done(); }
@Test public void testDontAllowRequiredOptionsWithDefaults() throws Exception { expect.expectMessage("Required options cannot have default values"); commandLine.newOption().shortOption("a").required(true).hasValue(true, "Hi"); }
@Test public void testDontAllowRequiredOptionsWithDefaults2() throws Exception { expect.expectMessage("Required options cannot have default values"); commandLine.newOption().shortOption("a").required(true).hasValue(false, true); }
@Test public void testDontAllowSetOnlyWithArgs() throws Exception { expect.expectMessage("Argument options cannot be set by default"); commandLine.newOption().shortOption("a").hasValue(true, true); }
@Test public void testAllowDefaultedArgumentlessOptions() throws Exception { commandLine.newOption().shortOption("a").hasValue(false, true); }