### Question:
MapRouteProgressChangeListener implements ProgressChangeListener { @Override public void onProgressChange(Location location, RouteProgress routeProgress) { DirectionsRoute currentRoute = routeProgress.directionsRoute(); List<DirectionsRoute> directionsRoutes = mapRoute.retrieveDirectionsRoutes(); int primaryRouteIndex = mapRoute.retrievePrimaryRouteIndex(); addNewRoute(currentRoute, directionsRoutes, primaryRouteIndex); mapRoute.addUpcomingManeuverArrow(routeProgress); } MapRouteProgressChangeListener(NavigationMapRoute mapRoute); @Override void onProgressChange(Location location, RouteProgress routeProgress);  }### Answer:
@Test public void onProgressChange_newRouteWithEmptyDirectionsRouteList() { NavigationMapRoute mapRoute = mock(NavigationMapRoute.class); when(mapRoute.retrieveDirectionsRoutes()).thenReturn(Collections.emptyList()); when(mapRoute.retrievePrimaryRouteIndex()).thenReturn(0); MapRouteProgressChangeListener progressChangeListener = new MapRouteProgressChangeListener(mapRoute); RouteProgress routeProgress = mock(RouteProgress.class); DirectionsRoute newRoute = mock(DirectionsRoute.class); when(routeProgress.directionsRoute()).thenReturn(newRoute); progressChangeListener.onProgressChange(mock(Location.class), routeProgress); verify(mapRoute).addRoute(eq(newRoute)); }