### Question:
NavigationHelper { public static StepIntersection findUpcomingIntersection(@NonNull List<StepIntersection> intersections, @Nullable LegStep upcomingStep, StepIntersection currentIntersection) { int intersectionIndex = intersections.indexOf(currentIntersection); int nextIntersectionIndex = intersectionIndex + ONE_INDEX; int intersectionSize = intersections.size(); boolean isValidUpcomingIntersection = nextIntersectionIndex < intersectionSize; if (isValidUpcomingIntersection) { return intersections.get(nextIntersectionIndex); } else if (upcomingStep != null) { List<StepIntersection> upcomingIntersections = upcomingStep.intersections(); if (upcomingIntersections != null && !upcomingIntersections.isEmpty()) { return upcomingIntersections.get(FIRST_INTERSECTION); } } return null; } 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 findUpcomingIntersection_beginningOfStepReturnsSecondIntersection() throws Exception { RouteProgress routeProgress = buildMultiLegRouteProgress(); RouteLegProgress legProgress = routeProgress.currentLegProgress(); RouteStepProgress stepProgress = legProgress.currentStepProgress(); List<StepIntersection> intersections = stepProgress.intersections(); StepIntersection upcomingIntersection = NavigationHelper.findUpcomingIntersection( intersections, legProgress.upComingStep(), stepProgress.currentIntersection() ); assertTrue(upcomingIntersection.equals(intersections.get(1))); }