List<Command> () { //command positional_argument --available-option=available_argument final Command command = EasyMock.createMock(Command.class); EasyMock.expect(command.getName()).andReturn("command").anyTimes(); EasyMock.expect(command.getHelp(true)).andReturn(new Help("some_text")).anyTimes(); EasyMock.expect(command.getHelp(false)).andReturn(new Help("some_text")).anyTimes(); final List<Option> options = new ArrayList<>(); final Pair<List<String>, Boolean> argument = Pair.create(Collections.singletonList("available_argument"), true); options.add(new Option(Pair.create(1, new Argument(new Help("option argument"), argument)), new Help(""), Collections.emptyList(), Collections.singletonList("--available-option"))); options.add(new Option(null, new Help(""), Collections.emptyList(), Collections.singletonList("--option-no-argument"))); EasyMock.expect(command.getOptions()).andReturn(options).anyTimes(); final ArgumentsInfo argumentInfo = new KnownArgumentsInfo(Collections.singletonList( new Argument(new Help("positional_argument"), Pair.create(Collections.singletonList("positional_argument"), true))), 1, 1); EasyMock.expect(command.getArgumentsInfo()).andReturn(argumentInfo) .anyTimes(); EasyMock.replay(command); return Collections.singletonList(command); }