### Question:
PlayerViewModel extends BaseViewModel { public void prev(){ if(currentIndex > 0) currentIndex--; else currentIndex = videoList.getValue().size() -1; currentVideo.setValue(videoList.getValue().get(currentIndex)); } @Inject  PlayerViewModel(VideoRepository videoRepository, AudioManager audioManager); void init(int videoId); void init(int videoId, int playlistId); LiveData<Video> getCurrentVideo(); LiveData<Integer> getVolumeValue(); void volumeUp(); void volumeDown(); void next(); void prev();  }### Answer:
@Test public void prev() throws Exception { final List<Video> videoList = videoRepository.getVideoList().blockingFirst(); viewModel.init(videoList.get(1).getId()); viewModel.getCurrentVideo().observeForever(mock(Observer.class)); viewModel.prev(); assertEquals(viewModel.getCurrentVideo().getValue().getId(), videoList.get(0).getId()); }