### Question:
NavigationHelper { static Point nextManeuverPosition(int stepIndex, List<LegStep> steps, List<Point> coords) { if (steps.size() > (stepIndex + 1)) { return steps.get(stepIndex + 1).maneuver().location(); } return !coords.isEmpty() ? coords.get(coords.size() - 1) : coords.get(coords.size()); } 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 nextManeuverPosition_correctlyReturnsNextManeuverPosition() throws Exception { DirectionsRoute route = buildMultiLegRoute(); List<Point> coordinates = PolylineUtils.decode( route.legs().get(0).steps().get(0).geometry(), Constants.PRECISION_6 ); Point nextManeuver = NavigationHelper.nextManeuverPosition(0, route.legs().get(0).steps(), coordinates); assertTrue(nextManeuver.equals(route.legs().get(0).steps().get(1).maneuver().location())); }
@Test public void nextManeuverPosition_correctlyReturnsNextManeuverPositionInNextLeg() throws Exception { DirectionsRoute route = buildMultiLegRoute(); int stepIndex = route.legs().get(0).steps().size() - 1; List<Point> coordinates = PolylineUtils.decode( route.legs().get(0).steps().get(stepIndex).geometry(), Constants.PRECISION_6); Point nextManeuver = NavigationHelper.nextManeuverPosition(stepIndex, route.legs().get(0).steps(), coordinates); assertTrue(nextManeuver.equals(route.legs().get(1).steps().get(0).maneuver().location())); }