@Test
public void testBind() {

    Option option = cliRunAdapter.getOption();
    doAnswer(new Answer() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            ListIterator<String> arguments = (ListIterator<String>) invocation.getArguments()[1];
            return arguments.hasNext();
        }
    }).when(option).canProcess(any(CommandLine.class), any(ListIterator.class));
    doAnswer(new Answer() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
            ListIterator<String> arguments = (ListIterator<String>) invocation.getArguments()[1];
            arguments.remove();
            return null;
        }
    }).when(option).process(any(CommandLine.class), any(ListIterator.class));
    OptionSet optionSet = parser.parse(new String[] { "--option" }, cliRunAdapter);
    verify(cliRunAdapter).bind(optionSet);
}