RepositoryPresenter extends MvpPresenter<RepositoryView> { public void updateLikes(List<Integer> inProgress, List<Integer> likedIds) { mInProgress = inProgress; mLikedIds = likedIds; if (mRepository == null || mInProgress == null || mLikedIds == null) { return; } boolean isInProgress = inProgress.contains(mRepository.getId()); boolean isLiked = likedIds.contains(mRepository.getId()); getViewState().updateLike(isInProgress, isLiked); } RepositoryPresenter(Repository repository); void updateLikes(List<Integer> inProgress, List<Integer> likedIds);  }
@Test public void repository_shouldSetLikeTrueForRepository() { presenter.updateLikes(Collections.singletonList(0), Collections.singletonList(0)); verify(repositoryViewState).updateLike(true, true); }
@Test public void repository_shouldSetLikeFalseForRepository() { presenter.updateLikes(Collections.singletonList(1), Collections.singletonList(1)); verify(repositoryViewState).updateLike(false, false); }