HelpFormatter { public void format(OutputStream output) { format(new PrintWriter(output)); }  void format(OutputStream output); void format(Writer writer); Set<HelpHint> getUsageOutputHints(); void setUsageOutputHints(Set<HelpHint> usageOutputHints); Set<HelpHint> getHelpOutputHints(); void setHelpOutputHints(Set<HelpHint> helpOutputHints); Set<HelpHint> getOptionOutputHints(); void setOptionOutputHints(Set<HelpHint> optionOutputHints); String getExecutable(); void setExecutable(String executable); String getHeader(); void setHeader(String header); String getDivider(); void setDivider(String divider); String getGutter(); void setGutter(String gutter); String getFooter(); void setFooter(String footer); Option getOption(); void setOption(Option option); Comparator getComparator(); void setComparator(Comparator comparator); OptionException getException(); void setException(OptionException exception); final static String GUTTER; static Set<HelpHint> USAGE_OUTPUT_HINTS; static Set<HelpHint> HELP_OUTPUT_HINTS; static Set<HelpHint> OPTION_OUTPUT_HINTS; }
@Test public void testFormat() throws IOException { Option option = mock(Option.class); helpFormatter.setOption(option); Writer writer = mock(Writer.class); helpFormatter.format(writer); verify(helpFormatter).header(writer); verify(helpFormatter).exception(writer); verify(helpFormatter).usage(writer); verify(helpFormatter).help(writer); verify(helpFormatter).footer(writer); }