### Question:
PlayerViewModel extends BaseViewModel { public void volumeDown(){ audioManager.adjustVolume(AudioManager.ADJUST_LOWER, AudioManager.FLAG_PLAY_SOUND); setCurrentVolumeVolume(); } @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 volumeDown() throws Exception { Observer observer = mock(Observer.class); viewModel.getVolumeValue().observeForever(observer); currentVolume = 5; viewModel.volumeDown(); verify(observer, times(2)).onChanged(any()); assertTrue(viewModel.getVolumeValue().getValue() == 4); }