### Question:
MediaControllerAdapter extends PlayerAdapter { @Override public void setShuffleAction(int shuffleActionIndex) { int shuffleMode = mapShuffleActionToShuffleMode(shuffleActionIndex); mController.getTransportControls().setShuffleMode(shuffleMode); } 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 testShuffleModeShuffleModeNone() throws Exception { synchronized (mWaitLock) { mCallback.reset(); mMediaControllerAdapter.setShuffleAction(PlaybackControlsRow.ShuffleAction.INDEX_OFF); mWaitLock.wait(); assertTrue(mCallback.mOnSetShuffleModeCalled); assertEquals(mCallback.mShuffleMode, PlaybackStateCompat.SHUFFLE_MODE_NONE); } }
@Test @SmallTest @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) public void testShuffleModeShuffleModeAll() throws InterruptedException { synchronized (mWaitLock) { mCallback.reset(); mMediaControllerAdapter.setShuffleAction(PlaybackControlsRow.ShuffleAction.INDEX_ON); mWaitLock.wait(); assertTrue(mCallback.mOnSetShuffleModeCalled); assertEquals(mCallback.mShuffleMode, PlaybackStateCompat.SHUFFLE_MODE_ALL); } }