### Question:
MusicActor extends Actor implements Disposable { public void play(Music theme) { if (this.theme != null) { this.theme.stop(); } this.theme = theme; this.theme.setLooping(true); this.theme.play(); }  void play(Music theme); @Override void dispose();  }### Answer:
@Test public void testPlay() { Music theme = mock(Music.class); actor.play(theme); verify(theme, times(1)).play(); verify(theme, times(1)).setLooping(true); }
@Test public void testPlaySecond() { Music first = mock(Music.class); Music second = mock(Music.class); actor.play(first); reset(first); actor.play(second); verify(first, times(1)).stop(); verify(second, times(1)).play(); verify(second, times(1)).setLooping(true); }