PlaybackManager implements Playback.Callback { @Override public void onPlaybackStatusChanged() { Timber.d("onPlaybackStatusChanged"); updatePlaybackState(); } PlaybackManager(QueueManager queueManager, PlaybackServiceCallback serviceCallback,
                  AndroidClock androidClock, Playback playback); Playback getPlayback(); @Override void onCompletion(); @Override void onPlaybackStatusChanged(); @Override void setCurrentTrack(Track track);  }
@Test public void onPlaybackStatusChanged() { when(mockPlayback.getState()) .thenReturn(PlaybackStateCompat.STATE_PLAYING) .thenReturn(PlaybackStateCompat.STATE_STOPPED); playbackManager.onPlaybackStatusChanged(); verify(mockServiceCallback, times(1)).onPlaybackStateUpdated(any(PlaybackStateCompat.class)); verify(mockServiceCallback, times(1)).onNotificationRequired(); playbackManager.onPlaybackStatusChanged(); verify(mockServiceCallback, times(2)).onPlaybackStateUpdated(any(PlaybackStateCompat.class)); verifyNoMoreInteractions(mockServiceCallback); }