public IntArrayList getEdgesWithDifferentHeading(int baseNode, double heading) {
        double xAxisAngle = AngleCalc.ANGLE_CALC.convertAzimuth2xaxisAngle(heading);
        IntArrayList edges = new IntArrayList(1);
        EdgeIterator iter = edgeExplorer.setBaseNode(baseNode);
        while (iter.next()) {
            PointList points = iter.fetchWayGeometry(FetchMode.ALL);
            double orientation = AngleCalc.ANGLE_CALC.calcOrientation(
                    points.getLat(0), points.getLon(0),
                    points.getLat(1), points.getLon(1)
            );

            orientation = AngleCalc.ANGLE_CALC.alignOrientation(xAxisAngle, orientation);
            double diff = Math.abs(orientation - xAxisAngle);

            if (diff > toleranceRad)
                edges.add(iter.getEdge());
        }
        return edges;
    }
@Test
    public void withQueryGraph() {
        //    2
        // 0 -x- 1
        BooleanEncodedValue accessEnc = new SimpleBooleanEncodedValue("access", true);
        DecimalEncodedValue speedEnc = new DecimalEncodedValueImpl("speed", 5, 5, false);
        EncodingManager em = EncodingManager.start().add(accessEnc).add(speedEnc).build();
        BaseGraph graph = new BaseGraph.Builder(em).create();
        NodeAccess na = graph.getNodeAccess();
        na.setNode(0, 48.8611, 1.2194);
        na.setNode(1, 48.8538, 2.3950);

        EdgeIteratorState edge = GHUtility.setSpeed(60, true, true, accessEnc, speedEnc, graph.edge(0, 1).setDistance(10));
        Snap snap = createSnap(edge, 48.859, 2.00, 0);
        QueryGraph queryGraph = QueryGraph.create(graph, snap);
        HeadingResolver resolver = new HeadingResolver(queryGraph);

        // if the heading points East we get the Western edge 0->2
        assertEquals("0->2", queryGraph.getEdgeIteratorState(1, Integer.MIN_VALUE).toString());
        assertEquals(IntArrayList.from(1), resolver.getEdgesWithDifferentHeading(2, 90));

        // if the heading points West we get the Eastern edge 2->1
        assertEquals("2->1", queryGraph.getEdgeIteratorState(2, Integer.MIN_VALUE).toString());
        assertEquals(IntArrayList.from(2), resolver.getEdgesWithDifferentHeading(2, 270));
    }