### Question:
MediaControllerAdapter extends PlayerAdapter { @Override public void setRepeatAction(int repeatActionIndex) { int repeatMode = mapRepeatActionToRepeatMode(repeatActionIndex); mController.getTransportControls().setRepeatMode(repeatMode); } MediaControllerAdapter(MediaControllerCompat controller); MediaControllerCompat getMediaController(); @Override void play(); @Override void pause(); @Override void seekTo(long positionInMs); @Override void next(); @Override void previous(); @Override void fastForward(); @Override void rewind(); @Override void setRepeatAction(int repeatActionIndex); @Override void setShuffleAction(int shuffleActionIndex); @Override boolean isPlaying(); @Override long getCurrentPosition(); @Override long getBufferedPosition(); CharSequence getMediaTitle(); CharSequence getMediaSubtitle(); Drawable getMediaArt(Context context); @Override long getDuration(); @Override void onAttachedToHost(PlaybackGlueHost host); @Override void onDetachedFromHost(); @Override void setProgressUpdatingEnabled(boolean enabled); @Override long getSupportedActions();  }### Answer:
@Test @SmallTest @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) public void testRepeatModeRepeatModeNone() throws Exception { synchronized (mWaitLock) { mCallback.reset(); mMediaControllerAdapter.setRepeatAction(PlaybackControlsRow.RepeatAction.INDEX_NONE); mWaitLock.wait(); assertTrue(mCallback.mOnSetRepeatModeCalled); assertEquals(mCallback.mRepeatMode, PlaybackStateCompat.REPEAT_MODE_NONE); } }
@Test @SmallTest @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) public void testRepeatModeRepeatModeOne() throws Exception { synchronized (mWaitLock) { mCallback.reset(); mMediaControllerAdapter.setRepeatAction(PlaybackControlsRow.RepeatAction.INDEX_ONE); mWaitLock.wait(); assertTrue(mCallback.mOnSetRepeatModeCalled); assertEquals(mCallback.mRepeatMode, PlaybackStateCompat.REPEAT_MODE_ONE); } }
@Test @SmallTest @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) public void testRepeatModeRepeatModeAll() throws Exception { synchronized (mWaitLock) { mCallback.reset(); mMediaControllerAdapter.setRepeatAction(PlaybackControlsRow.RepeatAction.INDEX_ALL); mWaitLock.wait(); assertTrue(mCallback.mOnSetRepeatModeCalled); assertEquals(mCallback.mRepeatMode, PlaybackStateCompat.REPEAT_MODE_ALL); } }