### Question:
NavigationHelper { static double stepDistanceRemaining(Point snappedPosition, int legIndex, int stepIndex, DirectionsRoute directionsRoute, List<Point> coordinates) { List<LegStep> steps = directionsRoute.legs().get(legIndex).steps(); Point nextManeuverPosition = nextManeuverPosition(stepIndex, steps, coordinates); LineString lineString = LineString.fromPolyline(steps.get(stepIndex).geometry(), Constants.PRECISION_6); if (snappedPosition.equals(nextManeuverPosition) || lineString.coordinates().size() < 2) { return 0; } LineString slicedLine = TurfMisc.lineSlice(snappedPosition, nextManeuverPosition, lineString); return TurfMeasurement.length(slicedLine, TurfConstants.UNIT_METERS); } private  NavigationHelper(); @NonNull static List<StepIntersection> createIntersectionsList(@NonNull LegStep currentStep, LegStep upcomingStep); @NonNull static List<Pair<StepIntersection, Double>> createDistancesToIntersections(List<Point> stepPoints,
                                                                             List<StepIntersection> intersections); static StepIntersection findCurrentIntersection(@NonNull List<StepIntersection> intersections,
                                                  @NonNull List<Pair<StepIntersection, Double>> measuredIntersections,
                                                  double stepDistanceTraveled); static StepIntersection findUpcomingIntersection(@NonNull List<StepIntersection> intersections,
                                                   @Nullable LegStep upcomingStep,
                                                   StepIntersection currentIntersection); @Nullable static CurrentLegAnnotation createCurrentAnnotation(CurrentLegAnnotation currentLegAnnotation,
                                                      RouteLeg leg, double legDistanceRemaining);  }### Answer:
@Test public void stepDistanceRemaining_returnsZeroWhenPositionsEqualEachOther() throws Exception { DirectionsRoute route = buildMultiLegRoute(); Point snappedPoint = Point.fromLngLat(-77.062996, 38.798405); List<Point> coordinates = PolylineUtils.decode( route.legs().get(0).steps().get(1).geometry(), Constants.PRECISION_6 ); double distance = NavigationHelper.stepDistanceRemaining(snappedPoint, 0, 1, route, coordinates); assertEquals(0.0, distance); }