/** * Rotates the tile if necessary * * @param tileToRotate the tile to rotate */ private void rotateTile(BoardTileModel tileToRotate) throws GridPositionOutOfBoundsException { GridModel.GridPosition gridPosition = tileToRotate.getNextGridPosition(); while (cannotPlaceTileAtPosition(gridPosition)) { tileToRotate.rotate(); gridPosition = tileToRotate.getNextGridPosition(); } }