### Question:
FavoritesPresenter { void showFavoritesList() { List<SozlikDbModel> list = sozlikDao.getAllFavorites(); if (list != null) { if (list.isEmpty()) { view.hideList(); view.showEmptyScreen(); } else { view.hideEmptyScreen(); view.showList(); view.showFavorites(list); } } } FavoritesPresenter(SozlikDao sozlikDao); void setView(FavoritesView view);  }### Answer:
@Test public void whenFavoritesListIsNullDoNothing() { when(sozlikDaoMock.getAllFavorites()).thenReturn(null); favoritesPresenter.showFavoritesList(); verifyNoMoreInteractions(favoritesViewMock); }
@Test public void whenFavoritesListIsEmptyShowEmptyScreenMessage() { List<SozlikDbModel> list = new ArrayList<>(); when(sozlikDaoMock.getAllFavorites()).thenReturn(list); favoritesPresenter.showFavoritesList(); verify(favoritesViewMock, times(1)).hideList(); verify(favoritesViewMock, times(1)).showEmptyScreen(); verifyNoMoreInteractions(favoritesViewMock); }
@Test public void whenFavoritesListIsNotEmptyShowList() { List<SozlikDbModel> list = new ArrayList<>(); list.add(new SozlikDbModel()); when(sozlikDaoMock.getAllFavorites()).thenReturn(list); favoritesPresenter.showFavoritesList(); verify(favoritesViewMock, times(1)).hideEmptyScreen(); verify(favoritesViewMock, times(1)).showList(); verify(favoritesViewMock, times(1)).showFavorites(list); verifyNoMoreInteractions(favoritesViewMock); }