assertEquals(SGFTree.NULL, collection.getPrev(root2));
assertEquals(root2, collection.getNextVariant(root1));
}
public void testNewNode() {
SGFTree tree = new SGFTree();
assertEquals(SGFTree.NONE, tree.getMoveProperty(SGFTree.ROOT));
int m = tree.newNode();
// add simple node
int m1 = tree.newNode(m, SGFTree.BLACK_MOVE, 3, 4);
assertEquals(SGFTree.BLACK_MOVE, tree.getMoveProperty(m1));
assertEquals(3, tree.getMoveX(m1));
assertEquals(4, tree.getMoveY(m1));
assertEquals(m, tree.getPrev(m1));
assertEquals(SGFTree.NULL, tree.getNext(m1));
assertEquals(SGFTree.NULL, tree.getNextVariant(m1));
assertEquals(m1, tree.getNext(m));
// add variant
int m2 = tree.newNode(m, SGFTree.BLACK_MOVE, 5, 6);
assertEquals(m, tree.getPrev(m2));
assertEquals(SGFTree.NULL, tree.getNext(m2));
assertEquals(SGFTree.NULL, tree.getNextVariant(m2));
assertEquals(m2, tree.getNextVariant(m1));
assertEquals(m1, tree.getNext(m));
}