}
}
public void testNavigation() {
DocumentedGame game = new DocumentedGame(4);
Board board = game.board;
try {
assertFalse(game.prev());
assertFalse(game.next());
SGFNode n2w, n3b_1, n3b_2;
// test forward/backward navigation
game.play(3, 3, Board.BLACK);
game.play(0, 1, Board.WHITE);
n2w = game.kifuLastMove();
game.play(0, 2, Board.BLACK);
n3b_1 = game.kifuLastMove();
assertTrue(game.prev());
assertSame(n2w, game.kifuLastMove());
assertEquals(board.pos(0, 1), game.lastMove);
assertEquals(Board.BLACK, game.colorToPlay);
assertTrue(game.next());
assertSame(n3b_1, game.kifuLastMove());
assertEquals(board.pos(0, 2), game.lastMove);
assertEquals(Board.WHITE, game.colorToPlay);
assertFalse(game.next());
// test variant navigation
assertTrue(game.prev());
game.play(0, 0, Board.BLACK); // variant to 0,2
n3b_2 = game.kifuLastMove();
assertEquals(board.pos(0, 0), game.lastMove);
assertFalse(game.nextVariant());
assertTrue(game.prevVariant());
assertSame(n3b_1, game.kifuLastMove());
assertEquals(board.pos(0, 2), game.lastMove);
assertFalse(game.prevVariant());
assertTrue(game.nextVariant());
assertSame(n3b_2, game.kifuLastMove());
assertEquals(board.pos(0, 0), game.lastMove);
assertEquals(Board.WHITE, game.colorToPlay);
// check if variant option is remembered
assertFalse(game.nextVariant());