### Question:
EdgeEvaluatorTravelTime implements EdgeEvaluator { @Override public double computeWeight(ModelEdge edge, Vehicle vehicle) { int maxVelocity; if (edge.isTravellingReverse()) { maxVelocity = Math.min(vehicle.getMaxReverseVelocity(), edge.getModelPath().getMaxReverseVelocity()); } else { maxVelocity = Math.min(vehicle.getMaxVelocity(), edge.getModelPath().getMaxVelocity()); } return (maxVelocity == 0) ? INFINITE_COSTS : edge.getModelPath().getLength() / maxVelocity; } EdgeEvaluatorTravelTime(); @Override double computeWeight(ModelEdge edge, Vehicle vehicle);  }### Answer:
@Test public void computeTravelTime() { ModelEdge edge = new ModelEdge( new Path("pathName", new Point("srcPoint").getReference(), new Point("dstPoint").getReference()) .withLength(10000) .withMaxVelocity(1000) .withMaxReverseVelocity(500), false); Vehicle vehicle = new Vehicle("someVehicle"); assertEquals(10.0, edgeEvaluator.computeWeight(edge, vehicle), 0.0); ModelEdge reverseEdge = new ModelEdge(edge.getModelPath(), true); assertEquals(20.0, edgeEvaluator.computeWeight(reverseEdge, vehicle), 0.0); }
@Test public void infiniteCostsForUntraversablePaths() { ModelEdge edge = new ModelEdge( new Path("pathName", new Point("srcPoint").getReference(), new Point("dstPoint").getReference()) .withLength(10000) .withMaxVelocity(0) .withMaxReverseVelocity(0), false); Vehicle vehicle = new Vehicle("someVehicle"); assertEquals(INFINITE_COSTS, edgeEvaluator.computeWeight(edge, vehicle), 0.0); ModelEdge reverseEdge = new ModelEdge(edge.getModelPath(), true); assertEquals(INFINITE_COSTS, edgeEvaluator.computeWeight(reverseEdge, vehicle), 0.0); }