@Override
    public EdgeIteratorState edge(int nodeA, int nodeB) {
        if (isFrozen())
            throw new IllegalStateException("Cannot create edge if graph is already frozen");
        if (nodeA == nodeB)
            // Loop edges would only make sense if their attributes were the same for both 'directions',
            // because for routing algorithms (which ignore the way geometry) loop edges do not even
            // have a well-defined 'direction'. So we either need to make sure the attributes
            // are the same for both directions, or reject loop edges altogether. Since we currently
            // don't know any use-case for loop edges in road networks (there is one for PT),
            // we reject them here.
            throw new IllegalArgumentException("Loop edges are not supported, got: " + nodeA + " - " + nodeB);
        int edgeId = store.edge(nodeA, nodeB);
        EdgeIteratorStateImpl edge = new EdgeIteratorStateImpl(this);
        boolean valid = edge.init(edgeId, nodeB);
        assert valid;
        return edge;
    }
@Test
    public void setGetFlags() {
        BaseGraph graph = createGHStorage();
        EnumEncodedValue<RoadClass> rcEnc = encodingManager.getEnumEncodedValue(RoadClass.KEY, RoadClass.class);
        EdgeIteratorState edge = graph.edge(0, 1).set(rcEnc, RoadClass.BRIDLEWAY);
        assertEquals(RoadClass.BRIDLEWAY, edge.get(rcEnc));
        edge.set(rcEnc, RoadClass.CORRIDOR);
        assertEquals(RoadClass.CORRIDOR, edge.get(rcEnc));
    }