@Test public void loveTrack_performsNoActionIfAlreadyLoved() { when(scroballDB.isLoved(any())).thenReturn(true); trackLover.loveTrack(track1); verify(scroballDB, never()).writeLove(any(), anyInt()); verifyZeroInteractions(lastfmClient); }
public synchronized void loveTrack(Track track) { if (scroballDB.isLoved(track)) { return; } LovedTracksEntry entry = scroballDB.writeLove(track, 0); pending.add(entry); lovePending(); eventBus.post(TrackLovedEvent.create()); }
TrackLover { public synchronized void loveTrack(Track track) { if (scroballDB.isLoved(track)) { return; } LovedTracksEntry entry = scroballDB.writeLove(track, 0); pending.add(entry); lovePending(); eventBus.post(TrackLovedEvent.create()); } }
TrackLover { public synchronized void loveTrack(Track track) { if (scroballDB.isLoved(track)) { return; } LovedTracksEntry entry = scroballDB.writeLove(track, 0); pending.add(entry); lovePending(); eventBus.post(TrackLovedEvent.create()); } TrackLover(
      LastfmClient lastfmClient, ScroballDB scroballDB, ConnectivityManager connectivityManager); }
TrackLover { public synchronized void loveTrack(Track track) { if (scroballDB.isLoved(track)) { return; } LovedTracksEntry entry = scroballDB.writeLove(track, 0); pending.add(entry); lovePending(); eventBus.post(TrackLovedEvent.create()); } TrackLover(
      LastfmClient lastfmClient, ScroballDB scroballDB, ConnectivityManager connectivityManager); synchronized void loveTrack(Track track); synchronized void lovePending(); }
TrackLover { public synchronized void loveTrack(Track track) { if (scroballDB.isLoved(track)) { return; } LovedTracksEntry entry = scroballDB.writeLove(track, 0); pending.add(entry); lovePending(); eventBus.post(TrackLovedEvent.create()); } TrackLover(
      LastfmClient lastfmClient, ScroballDB scroballDB, ConnectivityManager connectivityManager); synchronized void loveTrack(Track track); synchronized void lovePending();  }