@Override
    public void start(EdgeExplorer explorer, int startNode) {
        SimpleIntDeque fifo = new SimpleIntDeque();
        GHBitSet visited = createBitSet();
        visited.add(startNode);
        fifo.push(startNode);
        int current;
        while (!fifo.isEmpty()) {
            current = fifo.pop();
            if (!goFurther(current))
                continue;

            EdgeIterator iter = explorer.setBaseNode(current);
            while (iter.next()) {
                int connectedId = iter.getAdjNode();
                if (checkAdjacent(iter) && !visited.contains(connectedId)) {
                    visited.add(connectedId);
                    fifo.push(connectedId);
                }
            }
        }
    }
@Test
    public void testBFS2() {
        BreadthFirstSearch bfs = new BreadthFirstSearch() {
            @Override
            protected GHBitSet createBitSet() {
                return new GHTBitSet();
            }

            @Override
            public boolean goFurther(int v) {
                counter++;
                assertFalse(set.contains(v), "v " + v + " is already contained in set. iteration:" + counter);
                set.add(v);
                list.add(v);
                return super.goFurther(v);
            }
        };

        BaseGraph g = new BaseGraph.Builder(1).create();
        g.edge(1, 2);
        g.edge(2, 3);
        g.edge(3, 4);
        g.edge(1, 5);
        g.edge(5, 6);
        g.edge(6, 4);

        bfs.start(g.createEdgeExplorer(), 1);

        assertTrue(counter > 0);
        assertEquals("[1, 5, 2, 6, 3, 4]", list.toString());
    }