### Question:
RouteLegProgress { public double distanceTraveled() { double distanceTraveled = routeLeg().distance() - distanceRemaining(); if (distanceTraveled < 0) { distanceTraveled = 0; } return distanceTraveled; }  abstract int stepIndex(); double distanceTraveled(); abstract double distanceRemaining(); double durationRemaining(); float fractionTraveled(); @Nullable LegStep previousStep(); @NonNull LegStep currentStep(); @Nullable LegStep upComingStep(); @Nullable LegStep followOnStep(); abstract RouteStepProgress currentStepProgress(); abstract List<Point> currentStepPoints(); @Nullable abstract List<Point> upcomingStepPoints(); @Nullable abstract CurrentLegAnnotation currentLegAnnotation(); static Builder builder();  }### Answer:
@Test public void distanceTraveled_equalsZeroAtBeginning() throws Exception { RouteProgress routeProgress = buildBeginningOfLegRouteProgress(); assertEquals(0, routeProgress.currentLegProgress().distanceTraveled(), BaseTest.DELTA); }
@Test public void getDistanceTraveled_equalsLegDistanceAtEndOfLeg() throws Exception { RouteProgress routeProgress = buildEndOfLegRouteProgress(); DirectionsRoute route = buildTestDirectionsRoute(); RouteLeg firstLeg = route.legs().get(0); Double firstLegDistance = firstLeg.distance(); double distanceTraveled = routeProgress.currentLegProgress().distanceTraveled(); assertEquals(firstLegDistance, distanceTraveled, BaseTest.DELTA); }