@Override
    public void handleWayTags(int edgeId, EdgeIntAccess edgeIntAccess, ReaderWay readerWay, IntsRef relationFlags) {
        String roadClassTag = readerWay.getTag("highway");
        if (roadClassTag == null)
            return;
        RoadClass roadClass = RoadClass.find(roadClassTag);
        if (roadClass == OTHER && roadClassTag.endsWith("_link"))
            roadClass = RoadClass.find(roadClassTag.substring(0, roadClassTag.length() - 5));

        if (roadClass != OTHER)
            roadClassEnc.setEnum(false, edgeId, edgeIntAccess, roadClass);
    }
@Test
    public void testSimpleTags() {
        ReaderWay readerWay = new ReaderWay(1);
        ArrayEdgeIntAccess intAccess = new ArrayEdgeIntAccess(1);
        int edgeId = 0;
        readerWay.setTag("highway", "primary");
        parser.handleWayTags(edgeId, intAccess, readerWay, relFlags);
        assertEquals(RoadClass.PRIMARY, rcEnc.getEnum(false, edgeId, intAccess));

        intAccess = new ArrayEdgeIntAccess(1);
        readerWay.setTag("highway", "unknownstuff");
        parser.handleWayTags(edgeId, intAccess, readerWay, relFlags);
        assertEquals(RoadClass.OTHER, rcEnc.getEnum(false, edgeId, intAccess));

        intAccess = new ArrayEdgeIntAccess(1);
        readerWay.setTag("highway", "motorway_link");
        parser.handleWayTags(edgeId, intAccess, readerWay, relFlags);
        assertEquals(RoadClass.MOTORWAY, rcEnc.getEnum(false, edgeId, intAccess));

        readerWay = new ReaderWay(1);
        readerWay.setTag("highway", "cycleway");
        intAccess = new ArrayEdgeIntAccess(1);
        parser.handleWayTags(edgeId, intAccess, readerWay, relFlags);
        assertEquals(RoadClass.CYCLEWAY, rcEnc.getEnum(false, edgeId, intAccess));
    }