@Test
public void testEnforceHeadingByEdgeId()
{

    initHorseshoeGraph(g);
    EdgeIteratorState edge = GHUtility.getEdge(g, 0, 1);
    // query result on first vertical part of way (upward)
    QueryResult qr = fakeEdgeQueryResult(edge, 1.5, 0, 0);
    QueryGraph queryGraph = new QueryGraph(g);
    queryGraph.lookup(Arrays.asList(qr));
    // enforce coming in north
    queryGraph.enforceHeadingByEdgeId(2, 1, false);
    // test penalized south
    boolean expect = true;
    VirtualEdgeIteratorState incomingEdge = (VirtualEdgeIteratorState) queryGraph.getEdgeIteratorState(1, 2);
    VirtualEdgeIteratorState incomingEdgeReverse = (VirtualEdgeIteratorState) queryGraph.getEdgeIteratorState(1, incomingEdge.getBaseNode());
    // expect incoming edge in reverse direction to be unfavored
    assertEquals(expect, incomingEdge.getBoolean(EdgeIteratorState.K_UNFAVORED_EDGE, true, !expect));
    // expect reverse incoming edge to be unfavored
    assertEquals(expect, incomingEdgeReverse.getBoolean(EdgeIteratorState.K_UNFAVORED_EDGE, false, !expect));
    queryGraph.clearUnfavoredStatus();
    expect = false;
    assertEquals(expect, incomingEdge.getBoolean(EdgeIteratorState.K_UNFAVORED_EDGE, true, !expect));
    // expect reverse incoming edge to be unfavored
    assertEquals(expect, incomingEdgeReverse.getBoolean(EdgeIteratorState.K_UNFAVORED_EDGE, false, !expect));
}