@Override
public BranchSelector create(final TraversalBranch startBranch) {
return new BranchSelector(){
@Override
public TraversalBranch next() {
TraversalBranch branch=startBranch;
while (branch!=null) {
if (branch.depth()<branch.next().depth()) return branch;
branch=branch.next();
}
return null;
}
};
}