### Question:
PlayerServiceImpl implements PlayerService { @Override public void cleanAllScores() { lock.writeLock().lock(); try { semifinal.clean(); playerGames.forEach(PlayerGame::clearScore); } finally { lock.writeLock().unlock(); } }  @PostConstruct void init(); @Override Player register(String id, String ip, String roomName, String gameName); @Override void reloadAI(String id); @Override Player register(PlayerSave save); @Override void tick(); @Override List<Player> getAll(); @Override List<Player> getAll(String gameName); @Override void remove(String id); @Override void updateAll(List<PlayerInfo> players); @Override void update(Player player); @Override // TODO test me void loadSaveForAll(String gameName, String newSave); @Override boolean contains(String id); @Override Player get(String id); @Override void removeAll(); @Override void removeAll(String roomName); @Override Joystick getJoystick(String id); @Override void closeRegistration(); @Override boolean isRegistrationOpened(); @Override void openRegistration(); @Override void cleanAllScores(); @Override void cleanAllScores(String roomName); @Override void reloadAllRooms(); @Override void reloadAllRooms(String roomName); @Override Player getRandom(String gameType); @Override GameType getAnyGameWithPlayers();  }### Answer:
@Test public void shouldCleanAllScores() { createPlayer(VASYA); createPlayer(PETYA); playerService.cleanAllScores(); verify(playerScores(0)).clear(); verify(playerScores(1)).clear(); verify(gameField(VASYA)).clearScore(); verify(gameField(PETYA)).clearScore(); verify(semifinal).clean(); }
@Test public void shouldCleanAllScores_forRoom() { createPlayer(VASYA, "room1", "game1"); createPlayer(PETYA, "room1", "game1"); createPlayer(KATYA, "room2", "game1"); createPlayer(OLIA, "room3", "game3"); playerService.cleanAllScores("room1"); verify(playerScores(0)).clear(); verify(playerScores(1)).clear(); verifyNoMoreInteractions(playerScores(2)); verifyNoMoreInteractions(playerScores(3)); verify(gameField(VASYA)).clearScore(); verify(gameField(PETYA)).clearScore(); verify(gameField(KATYA), never()).clearScore(); verify(gameField(OLIA), never()).clearScore(); verify(semifinal).clean(); }