CliParser { public List<String> getMulti(String option) { return getMulti(option, CliConverter.STRING); } CliParser(CliCommand command, List<String> arguments); void verify(PrintStream out); String get(String option); T get(String option, CliConverter<T> converter); List<String> getMulti(String option); List<T> getMulti(String option, CliConverter<T> converter); List<String> getTrailing(); List<T> getTrailing(CliConverter<T> converter);  }
@Test(groups = "fast") public void testMultiValues() { CliCommand.Builder command = new CliCommand.Builder("test", "A test"); command.addOption("-m").allowMultiple(); CliParser parser = parser(command, "-m", "val1", "-m", "val2"); Assert.assertEquals(parser.getMulti("-m"), Arrays.asList("val1", "val2")); }