};
final DijkstraIterator iterator = createIterator();
iterator.setSource(ends[0]);
BasicGraphTraversal traversal = new BasicGraphTraversal(
builder().getGraph(), walker, iterator
);
traversal.init();
traversal.traverse();
GraphVisitor visitor = new GraphVisitor() {
public int visit(Graphable component) {
if (component.getID() <= suspend) assertTrue(component.isVisited());
else assertTrue(!component.isVisited());
return 0;
}
};
builder().getGraph().visitNodes(visitor);
assertTrue(walker.getCount() == nnodes-suspend+1);
//resume
traversal.traverse();
visitor = new GraphVisitor() {
public int visit(Graphable component) {
assertTrue(component.isVisited());
assertTrue(iterator.getCost(component) == (double)component.getID());