public Result doWork() {
        if (prepared)
            throw new IllegalStateException("Call doWork only once!");
        prepared = true;
        if (!graph.isFrozen()) {
            throw new IllegalStateException("Given BaseGraph has not been frozen yet");
        }
        if (chStore.getShortcuts() > 0) {
            throw new IllegalStateException("Given CHStore already contains shortcuts");
        }
        allSW.start();
        initFromGraph();
        runGraphContraction();
        allSW.stop();
        logFinalGraphStats();
        return new Result(
                chConfig, chStore,
                nodeContractor.getAddedShortcutsCount(),
                lazyUpdateSW.getCurrentSeconds(),
                periodicUpdateSW.getCurrentSeconds(),
                neighborUpdateSW.getCurrentSeconds(),
                allSW.getMillis()
        );
    }
@Test
    public void testCircleBug() {
        //  /--1
        // -0--/
        //  |
        g.edge(0, 1).setDistance(10).set(speedEnc, 60, 60);
        g.edge(0, 1).setDistance(4).set(speedEnc, 60, 60);
        g.edge(0, 2).setDistance(10).set(speedEnc, 60, 60);
        g.edge(0, 3).setDistance(10).set(speedEnc, 60, 60);
        PrepareContractionHierarchies prepare = createPrepareContractionHierarchies(g);
        PrepareContractionHierarchies.Result result = prepare.doWork();
        assertEquals(0, result.getShortcuts());
    }