@Test
public void testHandleWayTagsInfluencedByRelation()
{

    OSMWay osmWay = new OSMWay(1);
    osmWay.setTag("highway", "track");
    long allowed = encoder.acceptBit;
    OSMRelation osmRel = new OSMRelation(1);
    long relFlags = encoder.handleRelationTags(osmRel, 0);
    // unchanged
    long flags = encoder.handleWayTags(osmWay, allowed, relFlags);
    assertEquals(18, encoder.getSpeed(flags), 1e-1);
    assertPriority(PriorityCode.PREFER.getValue(), osmWay);
    assertEquals("way, unpaved", getWayTypeFromFlags(osmWay));
    // relation code is PREFER
    osmRel.setTag("route", "bicycle");
    osmRel.setTag("network", "lcn");
    relFlags = encoder.handleRelationTags(osmRel, 0);
    flags = encoder.handleWayTags(osmWay, allowed, relFlags);
    assertEquals(18, encoder.getSpeed(flags), 1e-1);
    assertPriority(PriorityCode.PREFER.getValue(), osmWay);
    assertEquals("way, unpaved", getWayTypeFromFlags(osmWay));
    // relation code is PREFER
    osmRel.setTag("network", "rcn");
    relFlags = encoder.handleRelationTags(osmRel, 0);
    flags = encoder.handleWayTags(osmWay, allowed, relFlags);
    assertPriority(PriorityCode.PREFER.getValue(), osmWay);
    assertEquals(18, encoder.getSpeed(flags), 1e-1);
    // relation code is PREFER
    osmRel.setTag("network", "ncn");
    relFlags = encoder.handleRelationTags(osmRel, 0);
    flags = encoder.handleWayTags(osmWay, allowed, relFlags);
    assertPriority(PriorityCode.PREFER.getValue(), osmWay);
    assertEquals(18, encoder.getSpeed(flags), 1e-1);
    // PREFER relation, but tertiary road
    // => no pushing section but road wayTypeCode and faster
    osmWay.clearTags();
    osmWay.setTag("highway", "tertiary");
    osmRel.setTag("route", "bicycle");
    osmRel.setTag("network", "lcn");
    relFlags = encoder.handleRelationTags(osmRel, 0);
    flags = encoder.handleWayTags(osmWay, allowed, relFlags);
    assertEquals(18, encoder.getSpeed(flags), 1e-1);
    assertPriority(PriorityCode.PREFER.getValue(), osmWay);
    assertEquals("", getWayTypeFromFlags(osmWay));
}