### Question:
QueryGraph implements Graph { public static QueryGraph lookup(Graph graph, QueryResult qr) { return QueryGraph.lookup(graph, Collections.singletonList(qr)); } private  QueryGraph(Graph graph, List<QueryResult> queryResults); private  QueryGraph(Graph graph, QueryGraph superQueryGraph); static QueryGraph lookup(Graph graph, QueryResult qr); static QueryGraph lookup(Graph graph, QueryResult fromQR, QueryResult toQR); static QueryGraph lookup(Graph graph, List<QueryResult> queryResults); @Override Graph getBaseGraph(); EdgeIteratorState getOriginalEdgeFromVirtNode(int nodeId); boolean isVirtualEdge(int edgeId); boolean isVirtualNode(int nodeId); boolean enforceHeading(int nodeId, double favoredHeading, boolean incoming); void unfavorVirtualEdgePair(int virtualNodeId, int virtualEdgeId); Set<EdgeIteratorState> getUnfavoredVirtualEdges(); void clearUnfavoredStatus(); @Override int getNodes(); @Override int getEdges(); @Override NodeAccess getNodeAccess(); @Override BBox getBounds(); @Override EdgeIteratorState getEdgeIteratorState(int origEdgeId, int adjNode); @Override EdgeExplorer createEdgeExplorer(final EdgeFilter edgeFilter); @Override EdgeExplorer createEdgeExplorer(); @Override AllEdgesIterator getAllEdges(); @Override EdgeIteratorState edge(int a, int b); @Override EdgeIteratorState edge(int a, int b, double distance, boolean bothDirections); @Override Graph copyTo(Graph g); @Override TurnCostStorage getTurnCostStorage(); @Override Weighting wrapWeighting(Weighting weighting); @Override int getOtherNode(int edge, int node); @Override boolean isAdjacentToNode(int edge, int node); Graph getMainGraph();  }### Answer:
@Test public void testEdgesShareOneNode() { initGraph(g); EdgeIteratorState iter = GHUtility.getEdge(g, 0, 2); QueryResult res1 = createLocationResult(0.5, 0, iter, 0, EDGE); iter = GHUtility.getEdge(g, 1, 0); QueryResult res2 = createLocationResult(1.5, 2, iter, 0, EDGE); QueryGraph queryGraph = lookup(Arrays.asList(res1, res2)); assertEquals(new GHPoint(0.5, 0), res1.getSnappedPoint()); assertEquals(new GHPoint(1.300019, 1.899962), res2.getSnappedPoint()); assertNotNull(GHUtility.getEdge(queryGraph, 0, 4)); assertNotNull(GHUtility.getEdge(queryGraph, 0, 3)); }