libandroid-navigation/src/main/java/com/mapbox/services/android/navigation/v5/utils/RouteUtils.java
public static boolean isLastLeg(RouteProgress routeProgress) {
    List<RouteLeg> legs = routeProgress.directionsRoute().legs();
    RouteLeg currentLeg = routeProgress.currentLeg();
    return currentLeg.equals(legs.get(legs.size() - 1));
  }
/**
   * Looks at the current {@link RouteProgress} list of legs and
   * checks if the current leg is the last leg.
   *
   * @param routeProgress the current route progress
   * @return true if last leg, false if not
   * @since 0.8.0
   */
Looks at the current  RouteProgress list of legs and
checks if the current leg is the last leg.

@param routeProgress the current route progress
@return true if last leg, false if not
@since 0.8.0
Looks at the current RouteProgress list of legs and checks if the current leg is the last leg . @param routeProgress the current route progress @return true if last leg false if not @since 0 . 8 . 0
public static boolean isLastLeg(RouteProgress routeProgress) {
    List<RouteLeg> legs = routeProgress.directionsRoute().legs();
    RouteLeg currentLeg = routeProgress.currentLeg();
    return currentLeg.equals(legs.get(legs.size() - 1));
  }
public static boolean isLastLeg ( RouteProgress routeProgress ) { List < RouteLeg > legs = routeProgress . directionsRoute ( ) . legs ( ) ; RouteLeg currentLeg = routeProgress . currentLeg ( ) ; return currentLeg . equals ( legs . get ( legs . size ( ) - 1 ) ) ; }
Looks at the current {@link RouteProgress} list of legs and
 checks if the current leg is the last leg.
Looks at the current { @link RouteProgress } list of legs and checks if the current leg is the last leg .