public ListIterator<Object> answer(InvocationOnMock invocation) throws Throwable {
return entityList.listIterator(index);
}
});
}
when(entitySelector.endingIterator()).thenAnswer(new Answer<Iterator<Object>>() {
public Iterator<Object> answer(InvocationOnMock invocation) throws Throwable {
return entityList.iterator();
}
});
when(entitySelector.isCountable()).thenReturn(true);