### Question:
RouteLegProgress { public float fractionTraveled() { float fractionTraveled = 1; if (routeLeg().distance() > 0) { fractionTraveled = (float) (distanceTraveled() / routeLeg().distance()); if (fractionTraveled < 0) { fractionTraveled = 0; } } return fractionTraveled; }  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 fractionTraveled_equalsZeroAtBeginning() throws Exception { RouteProgress routeProgress = buildBeginningOfLegRouteProgress(); assertEquals(0.0, routeProgress.currentLegProgress().fractionTraveled(), BaseTest.DELTA); }
@Test public void fractionTraveled_equalsOneAtEndOfLeg() throws Exception { RouteProgress routeProgress = buildEndOfLegRouteProgress(); assertEquals(1.0, routeProgress.currentLegProgress().fractionTraveled(), BaseTest.DELTA); }