class 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);
    }

}

class SentenceDetailPresenterTest {

    @Mock
    private SentenceDetail.View mView;
    private SentenceDetailViewModel mModel;
    @Mock
    private UseCaseHandler mLoadSentencesUseCaseHandler;
    @Mock
    private LoadSentencesUC mLoadSentencesUC;
    @Captor
    private ArgumentCaptor<LoadSentencesUC.LoadSentencesCallback> mLoadSentencesCallbackCaptor;
    @Captor
    private ArgumentCaptor<LoadSentenceUC.LoadSentenceCallback> mLoadSentenceCallbackCaptor;
    @Captor
    private ArgumentCaptor<LoadSentencesUC.LoadSentencesRequestParms> mLoadSentencesRequestParmsCaptor;
    @Captor
    private ArgumentCaptor<List<? extends Sentence>> mSentenceListCaptor;
    @Mock
    private UseCaseHandler mUpdateFavoriteSentenceUseCaseHandler;
    @Mock
    private UpdateFavoriteSentenceUC mUpdateFavoriteSentenceUC;
    @Mock
    private UseCaseHandler mSetPlayStyleUseCaseHandler;
    @Mock
    private SetPlayStyleUC mSetPlayStyleUC;
    @Captor
    private ArgumentCaptor<Integer> mSetPlayStyleParmsCaptor;
    @Mock
    private UseCaseHandler mGetPlayStyleUseCaseHandler;
    @Mock
    private GetPlayStyleUC mGetPlayStyleUCForPrepareMenu;
    @Mock
    private GetPlayStyleUC mGetPlayStyleUCForPlayAudio;
    @Captor
    private ArgumentCaptor<GetPlayStyleUC.GetPlayStyleCallback> mGetPlayStyleCallbackCaptor;
    @Mock
    private UseCaseHandler mFetchSentenceAudioUseCaseHander;
    @Mock
    private FetchSentenceAudioUC mFetchSentenceAudioUC;
    @Captor
    private ArgumentCaptor<FetchSentenceAudioUC.FetchSentenceAudioRequestParms> mFetchSentenceAudioRequestParmsCaptor;
    @Mock
    private AudioPlayer mAudioPlayer;
    @Mock
    private SentenceDataRepository mSentenceDataRepository;
    @Mock
    private EventBus mEventBus;
    @Captor
    private ArgumentCaptor<FocusedSentenceEvent> mFocusedSentenceEventCaptor;
    private SentenceDetailPresenter mSentenceDetailPresenter;
    @Mock
    private List<? extends Sentence> mSentences;
    @Mock
    private Sentence mCurrentSentence;

    @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);
        // not loop
        verify(mAudioPlayer).setLooping(true);
    }

}