### Question:
FavoritesPresenter { void deleteFavorite(SozlikDbModel dbModel) { if (dbModel != null) { dbModel.setFavourite(false); sozlikDao.update(dbModel); } } FavoritesPresenter(SozlikDao sozlikDao); void setView(FavoritesView view);  }### Answer:
@Test public void whenModelIsNotNullDeleteFavorite() { favoritesPresenter.deleteFavorite(sozlikDbModelMock); verify(sozlikDbModelMock, times(1)).setFavourite(false); verify(sozlikDaoMock, times(1)).update(sozlikDbModelMock); verifyNoMoreInteractions(sozlikDaoMock); verifyNoMoreInteractions(sozlikDbModelMock); }
@Test public void whenModelIsNullDoNothing() { favoritesPresenter.deleteFavorite(null); verifyNoMoreInteractions(sozlikDbModelMock); verifyNoMoreInteractions(sozlikDaoMock); }