### Question:
RouteLegProgress { public double durationRemaining() { return (1 - fractionTraveled()) * routeLeg().duration(); }  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 getDurationRemaining_equalsLegDurationAtBeginning() throws Exception { RouteProgress routeProgress = buildBeginningOfLegRouteProgress(); DirectionsRoute route = routeProgress.directionsRoute(); RouteLeg firstLeg = route.legs().get(0); Double firstLegDuration = firstLeg.duration(); double currentLegDurationRemaining = routeProgress.currentLegProgress().durationRemaining(); assertEquals(firstLegDuration, currentLegDurationRemaining, BaseTest.DELTA); }
@Test public void getDurationRemaining_equalsZeroAtEndOfLeg() throws Exception { RouteProgress routeProgress = buildEndOfLegRouteProgress(); assertEquals(0, routeProgress.currentLegProgress().durationRemaining(), BaseTest.DELTA); }