### Question:
SentenceDetailPresenter extends AbstractMvpPresenter<SentenceDetail.View, SentenceDetailViewModel> implements SentenceDetail.Presenter<SentenceDetail.View, SentenceDetailViewModel> { @Override public void setPlayStyle(int style) { getViewModel().setPlayStyle(style); mSetPlayStyleUC.requestParams(style).execute(mSetPlayStyleUseCaseHandler); mAudioPlayer.setLooping(style == Constants.PLAY_REPEAT); } SentenceDetailPresenter(SentenceDataRepository sentenceDataRepository, AudioPlayer audioPlayer); void setLoadSentencesUCAndHandler(LoadSentencesUC loadSentencesUC, UseCaseHandler useCaseHandler); void setUpdateFavoriteSentenceUCAndHandler(UpdateFavoriteSentenceUC updateFavoriteSentenceUC, UseCaseHandler useCaseHandler); void setSetPlayStyleUCAndHandler(SetPlayStyleUC setPlayStyleUC, UseCaseHandler useCaseHandler); void setGetPlayStyleUCAndHandler(GetPlayStyleUC getPlayStyleUCForPrepareMenu,
                                            GetPlayStyleUC getPlayStyleUCForPlayAudio,
                                            UseCaseHandler useCaseHandler); void setFetchSentenceAudioUCAndHandler(FetchSentenceAudioUC fetchSentenceAudioUC, UseCaseHandler useCaseHandler); @Override void loadSentences(boolean firstLoad); void loadCurrentSentense(LoadSentenceUC.LoadSentenceCallback callback); @Override void fetchSentenceAudio(); @Override void setPlayStyle(int style); @Override void setFavorite(@NonNull Sentence sentence, boolean favorite); @Override void onAudioFabButtonClicked(); @Subscribe(threadMode = ThreadMode.MAIN) @Override void onFetchingAudioEvent(FetchingAudioEvent fetchingAudioEvent); @Override void onDisplaySentence(Sentence sentence); @Override void onCreate(); @Override void onViewCreated(); @Override void onPrepareOptionsMenu(); @Override void onActivityCreated(); @Override void onResume(); @Override void onStop(); @Override void onDestroy(); @VisibleForTesting EventBus getEventBus();  }### Answer:
@Test public void testSetPlayStyle_Once() { mSentenceDetailPresenter.setPlayStyle(Constants.PLAY_ONCE); verify(mSetPlayStyleUC).requestParams(mSetPlayStyleParmsCaptor.capture()); assertEquals(mSetPlayStyleParmsCaptor.getValue().intValue(), mModel.getPlayStyle()); verify(mSetPlayStyleUC).execute(mSetPlayStyleUseCaseHandler); verify(mAudioPlayer).setLooping(false); }
@Test public void testSetPlayStyle_Repeat() { mSentenceDetailPresenter.setPlayStyle(Constants.PLAY_REPEAT); verify(mSetPlayStyleUC).requestParams(mSetPlayStyleParmsCaptor.capture()); assertEquals(mSetPlayStyleParmsCaptor.getValue().intValue(), mModel.getPlayStyle()); verify(mSetPlayStyleUC).execute(mSetPlayStyleUseCaseHandler); verify(mAudioPlayer).setLooping(true); }