MainPresenter extends RosiePresenter<MainView> { @Override protected void update() { super.update(); PaginatedCollection<Person> allPeopleInCache = getPeople.getAllPeopleInCache(); if (allPeopleInCache.getPage().getLimit() == 0) { loadPeople(); } else { getView().clearPeople(); showPeople(allPeopleInCache); offset = allPeopleInCache.getItems().size(); } } @Inject  MainPresenter(final UseCaseHandler useCaseHandler, final GetPeople getPeople); void onLoadMore();  }
@Test public void testUpdate_emptyList() throws Exception { PaginatedCollection<Person> emptyList = PaginatedCollectionUtils.createPaginatedCollection(new ArrayList<>()); when(getPeople.getAllPeopleInCache()).thenReturn(emptyList); mainPresenter.update(); verify(getPeople).getAllPeopleInCache(); }