static List<Point> decodeStepPoints(DirectionsRoute directionsRoute, List<Point> currentPoints,
                                      int legIndex, int stepIndex) {
    List<RouteLeg> legs = directionsRoute.legs();
    if (hasInvalidLegs(legs)) {
      return currentPoints;
    }
    List<LegStep> steps = legs.get(legIndex).steps();
    if (hasInvalidSteps(steps)) {
      return currentPoints;
    }
    boolean invalidStepIndex = stepIndex < 0 || stepIndex > steps.size() - 1;
    if (invalidStepIndex) {
      return currentPoints;
    }
    LegStep step = steps.get(stepIndex);
    if (step == null) {
      return currentPoints;
    }
    String stepGeometry = step.geometry();
    if (stepGeometry != null) {
      return PolylineUtils.decode(stepGeometry, PRECISION_6);
    }
    return currentPoints;
  }
static List < Point > decodeStepPoints ( DirectionsRoute directionsRoute , List < Point > currentPoints , int legIndex , int stepIndex ) { List < RouteLeg > legs = directionsRoute . legs ( ) ; if ( hasInvalidLegs ( legs ) ) { return currentPoints ; } List < LegStep > steps = legs . get ( legIndex ) . steps ( ) ; if ( hasInvalidSteps ( steps ) ) { return currentPoints ; } boolean invalidStepIndex = stepIndex < 0 || stepIndex > steps . size ( ) - 1 ; if ( invalidStepIndex ) { return currentPoints ; } LegStep step = steps . get ( stepIndex ) ; if ( step == null ) { return currentPoints ; } String stepGeometry = step . geometry ( ) ; if ( stepGeometry != null ) { return PolylineUtils . decode ( stepGeometry , PRECISION_6 ) ; } return currentPoints ; }
Given the current {@link DirectionsRoute} and leg / step index,
return a list of {@link Point} representing the current step.
<p>
This method is only used on a per-step basis as {@link PolylineUtils#decode(String, int)}
can be a heavy operation based on the length of the step.
<p>
Returns null if index is invalid.

@param directionsRoute for list of steps
@param legIndex        to get current step list
@param stepIndex       to get current step
@return list of {@link Point} representing the current step