@Override
    public void handleWayTags(int edgeId, EdgeIntAccess edgeIntAccess, ReaderWay readerWay, IntsRef relationFlags) {
        List<Map<String, Object>> nodeTags = readerWay.getTag("node_tags", null);
        if (nodeTags == null)
            return;

        for (int i = 0; i < nodeTags.size(); i++) {
            Map<String, Object> tags = nodeTags.get(i);
            if ("crossing".equals(tags.get("railway")) || "level_crossing".equals(tags.get("railway"))) {
                String barrierVal = (String) tags.get("crossing:barrier");
                crossingEnc.setEnum(false, edgeId, edgeIntAccess, (Helper.isEmpty(barrierVal) || "no".equals(barrierVal)) ? Crossing.RAILWAY : Crossing.RAILWAY_BARRIER);
                return;
            }

            String crossingSignals = (String) tags.get("crossing:signals");
            if ("yes".equals(crossingSignals)) {
                crossingEnc.setEnum(false, edgeId, edgeIntAccess, Crossing.TRAFFIC_SIGNALS);
                return;
            }

            String crossingMarkings = (String) tags.get("crossing:markings");
            if ("yes".equals(crossingMarkings)) {
                crossingEnc.setEnum(false, edgeId, edgeIntAccess, Crossing.MARKED);
                return;
            }

            String crossingValue = (String) tags.get("crossing");
            // some crossing values like "no" do not require highway=crossing and sometimes no crossing value exists although highway=crossing
            if (Helper.isEmpty(crossingValue) && ("no".equals(crossingSignals) || "no".equals(crossingMarkings)
                    || "crossing".equals(tags.get("highway")) || "crossing".equals(tags.get("footway")) || "crossing".equals(tags.get("cycleway")))) {
                crossingEnc.setEnum(false, edgeId, edgeIntAccess, Crossing.UNMARKED);
                // next node could have more specific Crossing value
                continue;
            }
            Crossing crossing = Crossing.find(crossingValue);
            if (crossing != Crossing.MISSING)
                crossingEnc.setEnum(false, edgeId, edgeIntAccess, crossing);
        }
    }
@Test
    public void testMarked() {
        EdgeIntAccess edgeIntAccess = new ArrayEdgeIntAccess(1);
        int edgeId = 0;
        parser.handleWayTags(edgeId, edgeIntAccess, createReader(new HashMap<>()), null);
        assertEquals(Crossing.MISSING, crossingEV.getEnum(false, edgeId, edgeIntAccess));

        parser.handleWayTags(edgeId, edgeIntAccess = new ArrayEdgeIntAccess(1),
                createReader(new PMap().putObject("highway", "crossing").toMap()), null);
        assertEquals(Crossing.UNMARKED, crossingEV.getEnum(false, edgeId, edgeIntAccess));

        parser.handleWayTags(edgeId, edgeIntAccess = new ArrayEdgeIntAccess(1),
                createReader(new PMap().putObject("crossing", "marked").toMap()), null);
        assertEquals(Crossing.MARKED, crossingEV.getEnum(false, edgeId, edgeIntAccess));

        parser.handleWayTags(edgeId, edgeIntAccess = new ArrayEdgeIntAccess(1),
                createReader(new PMap().putObject("crossing:markings", "yes").toMap()), null);
        assertEquals(Crossing.MARKED, crossingEV.getEnum(false, edgeId, edgeIntAccess));

        parser.handleWayTags(edgeId, edgeIntAccess = new ArrayEdgeIntAccess(1),
                createReader(new PMap().putObject("crossing:markings", "no").toMap()), null);
        assertEquals(Crossing.UNMARKED, crossingEV.getEnum(false, edgeId, edgeIntAccess));

        parser.handleWayTags(edgeId, edgeIntAccess = new ArrayEdgeIntAccess(1),
                createReader(new PMap().putObject("crossing:signals", "no").putObject("crossing:markings", "yes").toMap()), null);
        assertEquals(Crossing.MARKED, crossingEV.getEnum(false, edgeId, edgeIntAccess));
    }