### Question:
BlockAreaWeighting extends AbstractAdjustedWeighting { @Override public double calcEdgeWeight(EdgeIteratorState edgeState, boolean reverse) { if (blockArea.intersects(edgeState)) return Double.POSITIVE_INFINITY; return superWeighting.calcEdgeWeight(edgeState, reverse); } BlockAreaWeighting(Weighting superWeighting, GraphEdgeIdFinder.BlockArea blockArea); @Override double calcEdgeWeight(EdgeIteratorState edgeState, boolean reverse); @Override String getName();  }### Answer:
@Test public void testBlockedById() { GraphEdgeIdFinder.BlockArea bArea = new GraphEdgeIdFinder.BlockArea(graph); EdgeIteratorState edge = graph.getEdgeIteratorState(0, 1); BlockAreaWeighting instance = new BlockAreaWeighting(new FastestWeighting(encoder), bArea); assertEquals(94.35, instance.calcEdgeWeight(edge, false), .01); bArea.add(0); instance = new BlockAreaWeighting(new FastestWeighting(encoder), bArea); assertEquals(Double.POSITIVE_INFINITY, instance.calcEdgeWeight(edge, false), .01); }
@Test public void testBlockedByShape() { EdgeIteratorState edge = graph.getEdgeIteratorState(0, 1); GraphEdgeIdFinder.BlockArea bArea = new GraphEdgeIdFinder.BlockArea(graph); BlockAreaWeighting instance = new BlockAreaWeighting(new FastestWeighting(encoder), bArea); assertEquals(94.35, instance.calcEdgeWeight(edge, false), 0.01); bArea.add(new Circle(0.01, 0.01, 100)); assertEquals(Double.POSITIVE_INFINITY, instance.calcEdgeWeight(edge, false), .01); bArea = new GraphEdgeIdFinder.BlockArea(graph); instance = new BlockAreaWeighting(new FastestWeighting(encoder), bArea); bArea.add(new Circle(0.1, 0.1, 100)); assertEquals(94.35, instance.calcEdgeWeight(edge, false), .01); }