Board implements Serializable { public void setUpHandicap(int handicapSize) { clear(); for (int i = 0; i < handicapSize; i++) { if ((handicapSize == 6 || handicapSize == 8) && i == 4) { i++; handicapSize++; } placeInitialStone(BLACK, coords.at(HANDICAP_LOCATIONS[i])); } setColorToPlay(WHITE); } Board(int width); void addObserver(BoardObserver observer); void clear(); void clearPreservingInitialStones(); void copyDataFrom(Board that); short getChainNextPoint(short p); short getChainRoot(short p); Color getColorAt(short p); StoneColor getColorToPlay(); CoordinateSystem getCoordinateSystem(); long getFancyHash(); long getHash(); ShortSet getLiberties(short p); int getNeighborsOfColor(short p, Color color); short getPasses(); int getTurn(); ShortSet getVacantPoints(); boolean hasMaxNeighborsForColor(StoneColor color, short p); boolean isLegal(short p); void pass(); void placeInitialStone(StoneColor color, short p); Legality play(short p); Legality play(String move); Legality playFast(short p); void setColorToPlay(StoneColor stoneColor); void setPasses(short passes); void setUpHandicap(int handicapSize); void setUpProblem(String[] diagram, StoneColor colorToPlay); @Override String toString(); void removeStones(ShortSet ourDead);  }
@Test public void testSetUpHandicap() { String[] problem = new String[] { "...................", "...................", "...................", "...#...........#...", "...................", "...................", "...................", "...................", "...................", ".........#.........", "...................", "...................", "...................", "...................", "...................", "...#...........#...", "...................", "...................", "..................." }; String[] problem2 = new String[] { "...................", "...................", "...................", "...#.....#.....#...", "...................", "...................", "...................", "...................", "...................", "...#...........#...", "...................", "...................", "...................", "...................", "...................", "...#.....#.....#...", "...................", "...................", "..................." }; board = new Board(19); board.setUpProblem(problem, WHITE); long hash = board.getFancyHash(); board.setUpHandicap(5); assertEquals(hash, board.getFancyHash()); board.setUpProblem(problem2, WHITE); hash = board.getFancyHash(); board.setUpHandicap(8); assertEquals(hash, board.getFancyHash()); }