### Question:
GameBoard { public boolean addObstacle(Obstacle o) { return verifyObstacle(o) ? obstacles.add(o) : false; } GameBoard();  GameBoard(int map); boolean verifyObstacle(Obstacle o); boolean addObstacle(Obstacle o); boolean addObstacle(MovingObstacle o); Player addPlayer(String playerId, String playerName); boolean removePlayer(Player p); void dumpBoard(); boolean moveObjects(); void broadcastToAI(); void addAI(); boolean removeAI(Player p); static final int BOARD_SIZE; static final short SPOT_AVAILABLE; @JsonbTransient
    final short[][] board; final Set<Obstacle> obstacles; final Set<MovingObstacle> movingObstacles; final Set<Player> players; }### Answer:
@Test public void testAddObstacle() { assertTrue(board.addObstacle(new Obstacle(5, 10, 0, 0))); verifyTaken(0, 0); verifyTaken(4, 9); }
@Test public void testAdd2Obstacles() { assertTrue(board.addObstacle(new Obstacle(5, 10, 0, 0))); assertTrue(board.addObstacle(new Obstacle(25, 25, BOARD_SIZE - 25, BOARD_SIZE - 25))); verifyTaken(0, 0); verifyTaken(4, 9); verifyTaken(BOARD_SIZE - 25, BOARD_SIZE - 25); verifyTaken(BOARD_SIZE - 1, BOARD_SIZE - 1); }
@Test public void testOverlappingObstacles() { assertTrue(board.addObstacle(new Obstacle(5, 10, 0, 0))); assertFalse(board.addObstacle(new Obstacle(5, 10, 4, 9))); verifyTaken(0, 0); verifyTaken(4, 9); verifyAvailable(5, 9); verifyAvailable(4, 10); verifyAvailable(5, 10); }
@Test public void testIllegalObstacle() { try { board.addObstacle(new Obstacle(2, 1, -3, 4)); fail("Should not be able to add obstacle off of board"); } catch (IllegalArgumentException e) { } try { board.addObstacle(new Obstacle(BOARD_SIZE + 1, 1, 3, 4)); fail("Should not be able to add obstacle off of board"); } catch (IllegalArgumentException e) { } }