AudioPlayer implements MediaPlayerControl, OnPreparedListener { public void release() { mediaPlayer.reset(); mediaPlayer.release(); } @Inject  AudioPlayer(MediaPlayer mediaPlayer, EventBus eventBus, EpisodeFile episodeFile); MediaPlayer play(Episode episode); void release(); @Override void start(); @Override void pause(); @Override int getDuration(); @Override int getCurrentPosition(); @Override void seekTo(int pos); @Override boolean isPlaying(); @Override int getBufferPercentage(); @Override boolean canPause(); @Override boolean canSeekBackward(); @Override boolean canSeekForward(); @Override int getAudioSessionId(); @Override void onPrepared(MediaPlayer mediaPlayer);  }
@Test public void itReleasesMediaPlayer() { audioPlayer.release(); InOrder order = inOrder(mediaPlayerMock); order.verify(mediaPlayerMock).reset(); order.verify(mediaPlayerMock).release(); }