RequiredParameters { public String getHelp() { StringBuilder sb = new StringBuilder(data.size() * HELP_TEXT_LENGTH_PER_PARAM); sb.append("Required Parameters:"); sb.append(HELP_TEXT_LINE_DELIMITER); for (Option o : data.values()) { sb.append(this.helpText(o)); } sb.append(HELP_TEXT_LINE_DELIMITER); return sb.toString(); } RequiredParameters(); Option add(String name); void add(Option option); void applyTo(ParameterTool parameterTool); String getHelp(); String getHelp(List<String> missingArguments);  }
@Test public void testPrintHelpWithMissingParams() { RequiredParameters required = new RequiredParameters(); String helpText = required.getHelp(Arrays.asList("param1", "param2", "paramN")); Assert.assertThat(helpText, CoreMatchers.allOf( containsString("Missing arguments for:"), containsString("param1 "), containsString("param2 "), containsString("paramN "))); }