@Override
    public void handleWayTags(int edgeId, EdgeIntAccess edgeIntAccess, ReaderWay way, IntsRef relationFlags) {
        String highwayValue = way.getTag("highway");
        if (skipEmergency && "service".equals(highwayValue) && "emergency_access".equals(way.getTag("service")))
            return;

        int firstIndex = way.getFirstIndex(restrictionKeys);
        String firstValue = firstIndex < 0 ? "" : way.getTag(restrictionKeys.get(firstIndex), "");
        if (restrictedValues.contains(firstValue) && !hasTemporalRestriction(way, firstIndex, restrictionKeys))
            return;

        if (way.hasTag("gh:barrier_edge") && way.hasTag("node_tags")) {
            List<Map<String, Object>> nodeTags = way.getTag("node_tags", null);
            Map<String, Object> firstNodeTags = nodeTags.get(0);
            // a barrier edge has the restriction in both nodes and the tags are the same -> get(0)
            firstValue = getFirstPriorityNodeTag(firstNodeTags, restrictionKeys);
            String barrierValue = firstNodeTags.containsKey("barrier") ? (String) firstNodeTags.get("barrier") : "";
            if (restrictedValues.contains(firstValue) || barriers.contains(barrierValue)
                    || "yes".equals(firstNodeTags.get("locked")) && !INTENDED.contains(firstValue))
                return;
        }

        if (FerrySpeedCalculator.isFerry(way)) {
            boolean isCar = restrictionKeys.contains("motorcar");
            if (INTENDED.contains(firstValue)
                    // implied default is allowed only if foot and bicycle is not specified:
                    || isCar && firstValue.isEmpty() && !way.hasTag("foot") && !way.hasTag("bicycle")
                    // if hgv is allowed then smaller trucks and cars are allowed too even if not specified
                    || isCar && way.hasTag("hgv", "yes")) {
                accessEnc.setBool(false, edgeId, edgeIntAccess, true);
                accessEnc.setBool(true, edgeId, edgeIntAccess, true);
            }
        } else {
            boolean isRoundabout = roundaboutEnc.getBool(false, edgeId, edgeIntAccess);
            boolean ignoreOneway = "no".equals(way.getFirstValue(ignoreOnewayKeys));
            boolean isBwd = isBackwardOneway(way);
            if (!ignoreOneway && (isBwd || isRoundabout || isForwardOneway(way))) {
                accessEnc.setBool(isBwd, edgeId, edgeIntAccess, true);
            } else {
                accessEnc.setBool(false, edgeId, edgeIntAccess, true);
                accessEnc.setBool(true, edgeId, edgeIntAccess, true);
            }
        }
    }
@Test
    public void testOneway() {
        ReaderWay way = new ReaderWay(1);
        way.setTag("highway", "primary");
        way.setTag("oneway", "yes");

        int edgeId = 0;
        EdgeIntAccess edgeIntAccess = ArrayEdgeIntAccess.createFromBytes(em.getBytesForFlags());
        parser.handleWayTags(edgeId, edgeIntAccess, way, null);
        assertTrue(busAccessEnc.getBool(false, edgeId, edgeIntAccess));
        assertFalse(busAccessEnc.getBool(true, edgeId, edgeIntAccess));

        way.clearTags();
        way.setTag("highway", "tertiary");
        way.setTag("vehicle:forward", "no");
        edgeIntAccess = ArrayEdgeIntAccess.createFromBytes(em.getBytesForFlags());
        parser.handleWayTags(edgeId, edgeIntAccess, way, null);
        assertFalse(busAccessEnc.getBool(false, edgeId, edgeIntAccess));
        assertTrue(busAccessEnc.getBool(true, edgeId, edgeIntAccess));

        way.clearTags();
        way.setTag("highway", "tertiary");
        way.setTag("vehicle:backward", "no");
        edgeIntAccess = ArrayEdgeIntAccess.createFromBytes(em.getBytesForFlags());
        parser.handleWayTags(edgeId, edgeIntAccess, way, null);
        assertTrue(busAccessEnc.getBool(false, edgeId, edgeIntAccess));
        assertFalse(busAccessEnc.getBool(true, edgeId, edgeIntAccess));

        way.setTag("bus:backward", "yes");
        edgeIntAccess = ArrayEdgeIntAccess.createFromBytes(em.getBytesForFlags());
        parser.handleWayTags(edgeId, edgeIntAccess, way, null);
        assertTrue(busAccessEnc.getBool(false, edgeId, edgeIntAccess));
        assertTrue(busAccessEnc.getBool(true, edgeId, edgeIntAccess));

        way.clearTags();
        way.setTag("highway", "tertiary");
        way.setTag("vehicle:backward", "yes");
        way.setTag("bus:backward", "no");
        edgeIntAccess = ArrayEdgeIntAccess.createFromBytes(em.getBytesForFlags());
        parser.handleWayTags(edgeId, edgeIntAccess, way, null);
        assertTrue(busAccessEnc.getBool(false, edgeId, edgeIntAccess));
        assertFalse(busAccessEnc.getBool(true, edgeId, edgeIntAccess));
    }