MediaPlayers extends Helper { public void removeAll() { while (!players.isEmpty()) { remove(players.firstEntry().getValue().getPlayerId()); } } MediaPlayers(Tracker tracker); MediaPlayer add(); MediaPlayer add(int playerId); void remove(int playerId); void removeAll();  }
@Test public void removeAllTest() { assertEquals(1, mediaPlayers.add().getPlayerId()); assertEquals(2, mediaPlayers.add().getPlayerId()); assertEquals(3, mediaPlayers.add().getPlayerId()); assertEquals(3, mediaPlayers.players.size()); mediaPlayers.removeAll(); assertEquals(0, mediaPlayers.players.size()); }