### Question:
CurrentPlayerSwitch extends AbstractGameRules { public void switchCurrentPlayer(Game game) { if (game.isFinished()) { return; } int iterations = 0; Player player = game.getCurrentPlayer(); boolean isMoveFeasible; do { player = getNextPlayer(game, player.getId()); isMoveFeasible = moveFeasibilityChecker .isAnyMoveFeasible(game.getBoard().getCells(), player.getId()); if (!isMoveFeasible) { switchPlayerCells(game, player.getId()); } iterations++; if (iterations > game.getPlayers().size()) { throw new IllegalStateException(THERE_IS_DEAD_LOOP_ERR); } } while (!isMoveFeasible); game.setCurrentPlayer(player); }  void switchCurrentPlayer(Game game);  }### Answer:
@Test(expected = IllegalStateException.class) public void exception_whenNobodyHasFeasibleMove() { currentPlayerSwitch.switchCurrentPlayer(game); }
@Test public void notSwitchPlayer_whenGameFinished() { game.setFinished(true); currentPlayerSwitch.switchCurrentPlayer(game); assertThat(game.getCurrentPlayer().getId()).isEqualTo(FIRST_PLAYER_ID); }