@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); }
public void play(Music theme) { if (this.theme != null) { this.theme.stop(); } this.theme = theme; this.theme.setLooping(true); this.theme.play(); }
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(); } }
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(); }  }
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(); }
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();  }