public void testUndoAddEmpty() {
try {
String data = "(;GM[1]FF[3]SZ[4]HA[0];AW[bb]AB[aa]PL[2];W[cc]AE[aa]))";
SGFParser parser = new SGFParser(data);
SGFNode tree = parser.parse();
DocumentedGame game = new DocumentedGame(tree);
game.next();
assertEquals(Board.BLACK, game.board.get(0, 0));
assertEquals(Board.WHITE, game.board.get(1, 1));
assertEquals(Board.NONE, game.board.get(2, 2));
game.next();
assertEquals(Board.NONE, game.board.get(0, 0));
assertEquals(Board.WHITE, game.board.get(1, 1));
assertEquals(Board.WHITE, game.board.get(2, 2));
game.prev();
assertEquals(Board.BLACK, game.board.get(0, 0));
assertEquals(Board.WHITE, game.board.get(1, 1));
assertEquals(Board.NONE, game.board.get(2, 2));
game.prev();
assertEquals(Board.NONE, game.board.get(0, 0));
assertEquals(Board.NONE, game.board.get(1, 1));
assertEquals(Board.NONE, game.board.get(2, 2));
game.next();
game.next();
game.undo();
assertEquals(Board.BLACK, game.board.get(0, 0));
assertEquals(Board.WHITE, game.board.get(1, 1));
assertEquals(Board.NONE, game.board.get(2, 2));
game.undo();
assertEquals(Board.NONE, game.board.get(0, 0));
assertEquals(Board.NONE, game.board.get(1, 1));
assertEquals(Board.NONE, game.board.get(2, 2));
} catch (Exception e) {
e.printStackTrace();