@Test
public void shouldReleaseMediaRecorderAndPlayerOnStopIfPresent(){

    MediaPlayer mediaPlayer = mock(MediaPlayer.class);
    MediaRecorder mediaRecorder = mock(MediaRecorder.class);
    activity.setMediaPlayer(mediaPlayer);
    activity.setMediaRecorder(mediaRecorder);
    activity.onStop();
    verify(mediaPlayer).release();
    verify(mediaRecorder).release();
    assertNull(activity.getMediaPlayer());
    assertNull(activity.getMediaRecorder());
}