Arguments { public String parameter(String arg) { return repeatedParameter(arg).get(0); } Arguments(Map<String, List<String>> arguments, List<String> positionalArguments); boolean has(String arg); String parameter(String arg); String parameter(String arg, String defaultValue); List<String> repeatedParameter(String arg); List<String> repeatedParameter(String arg, List<String> defaultValues); List<String> positionalArguments(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void throwsIfParameterNotPresent() { Assertions.assertThrows(CliError.class, () -> { Arguments arguments = new Arguments(MapUtils.of(), ListUtils.of()); arguments.parameter("foo"); }); }
@Test public void throwsIfParameterIsOption() { Assertions.assertThrows(CliError.class, () -> { Arguments arguments = new Arguments(MapUtils.of("foo", ListUtils.of()), ListUtils.of()); arguments.parameter("foo"); }); }