### Question:
BidirPathExtractor { public static Path extractPath(Graph graph, Weighting weighting, SPTEntry fwdEntry, SPTEntry bwdEntry, double weight) { return new BidirPathExtractor(graph, weighting).extract(fwdEntry, bwdEntry, weight); } protected  BidirPathExtractor(Graph graph, Weighting weighting); static Path extractPath(Graph graph, Weighting weighting, SPTEntry fwdEntry, SPTEntry bwdEntry, double weight);  }### Answer:
@Test public void testExtract2() { Graph g = createGraph(); g.edge(1, 2, 10, false); g.edge(2, 3, 20, false); TurnCostStorage turnCostStorage = g.getTurnCostStorage(); DecimalEncodedValue turnCostEnc = encodingManager.getDecimalEncodedValue(TurnCost.key(carEncoder.toString())); IntsRef tcFlags = TurnCost.createFlags(); turnCostEnc.setDecimal(false, tcFlags, 5); turnCostStorage.setTurnCost(tcFlags, 0, 2, 1); SPTEntry fwdEntry = new SPTEntry(0, 2, 0.6); fwdEntry.parent = new SPTEntry(EdgeIterator.NO_EDGE, 1, 0); SPTEntry bwdEntry = new SPTEntry(1, 2, 1.2); bwdEntry.parent = new SPTEntry(EdgeIterator.NO_EDGE, 3, 0); Path p = BidirPathExtractor.extractPath(g, new FastestWeighting(carEncoder, new DefaultTurnCostProvider(carEncoder, turnCostStorage)), fwdEntry, bwdEntry, 0); p.setWeight(5 + 1.8); assertEquals(IntArrayList.from(1, 2, 3), p.calcNodes()); assertEquals(30, p.getDistance(), 1e-4); assertEquals(5 + 1.8, p.getWeight(), 1e-4); assertEquals(5000 + 1800, p.getTime(), 1.e-6); }