### Question:
Options implements Serializable { @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append("[ Options: [ short "); buf.append(shortOpts.toString()); buf.append(" ] [ long "); buf.append(longOpts); buf.append(" ]"); return buf.toString(); }  Options addOptionGroup(OptionGroup group); Options addOption(String opt, String description); Options addOption(String opt, boolean hasArg, String description); Options addOption(String opt, String longOpt, boolean hasArg, String description); Options addRequiredOption(String opt, String longOpt, boolean hasArg, String description); Options addOption(Option opt); Collection<Option> getOptions(); List getRequiredOptions(); Option getOption(String opt); List<String> getMatchingOptions(String opt); boolean hasOption(String opt); boolean hasLongOption(String opt); boolean hasShortOption(String opt); OptionGroup getOptionGroup(Option opt); @Override String toString();  }### Answer:
@Test public void testToString() { Options options = new Options(); options.addOption("f", "foo", true, "Foo"); options.addOption("b", "bar", false, "Bar"); String s = options.toString(); assertNotNull("null string returned", s); assertTrue("foo option missing", s.toLowerCase().contains("foo")); assertTrue("bar option missing", s.toLowerCase().contains("bar")); }