@Override
    public IntContainer contractNode(int node) {
        long degree = findAndHandleShortcuts(node, this::addOrUpdateShortcut, (int) (meanDegree * params.maxPollFactorContraction));
        insertShortcuts(node);
        // put weight factor on meanDegree instead of taking the average => meanDegree is more stable
        meanDegree = (meanDegree * 2 + degree) / 3;
        return prepareGraph.disconnect(node);
    }
@Test
    public void testContractNode_directed_withWitness() {
        // 0 --> 1 --> 2
        //  \_________/
        graph.edge(0, 1).setDistance(1).set(speedEnc, 60, 0);
        graph.edge(1, 2).setDistance(2).set(speedEnc, 60, 0);
        graph.edge(0, 2).setDistance(1).set(speedEnc, 60, 0);
        freeze();
        setMaxLevelOnAllNodes();
        createNodeContractor().contractNode(1);
        checkNoShortcuts();
    }