docs: @NonNull
    public static LineString lineSliceAlong(@NonNull LineString line,
                                            @FloatRange(from = 0) double startDist,
                                            @FloatRange(from = 0) double stopDist,
                                            @NonNull @TurfConstants.TurfUnitCriteria String units) {
  
      List<Point> coords = line.coordinates();
  
      if (coords.size() < 2) {
        throw new TurfException("Turf lineSlice requires a LineString Geometry made up of "
          + "at least 2 coordinates. The LineString passed in only contains " + coords.size() + ".");
      } else if (startDist == stopDist) {
        throw new TurfException("Start and stop distance in Turf lineSliceAlong "
          + "cannot equal each other.");
      }
  
      List<Point> slice = new ArrayList<>(2);
  
      double travelled = 0;
      for (int i = 0; i < coords.size(); i++) {
  
        if (startDist >= travelled && i == coords.size() - 1) {
          break;
  
        } else if (travelled > startDist && slice.size() == 0) {
          double overshot = startDist - travelled;
          if (overshot == 0) {
            slice.add(coords.get(i));
            return LineString.fromLngLats(slice);
          }
          double direction = TurfMeasurement.bearing(coords.get(i), coords.get(i - 1)) - 180;
          Point interpolated = TurfMeasurement.destination(coords.get(i), overshot, direction, units);
          slice.add(interpolated);
        }
  
        if (travelled >= stopDist) {
          double overshot = stopDist - travelled;
          if (overshot == 0) {
            slice.add(coords.get(i));
            return LineString.fromLngLats(slice);
          }
          double direction = TurfMeasurement.bearing(coords.get(i), coords.get(i - 1)) - 180;
          Point interpolated = TurfMeasurement.destination(coords.get(i), overshot, direction, units);
          slice.add(interpolated);
          return LineString.fromLngLats(slice);
        }
  
        if (travelled >= startDist) {
          slice.add(coords.get(i));
        }
  
        if (i == coords.size() - 1) {
          return LineString.fromLngLats(slice);
        }
  
        travelled += TurfMeasurement.distance(coords.get(i), coords.get(i + 1), units);
      }
  
      if (travelled < startDist) {
        throw new TurfException("Start position is beyond line");
      }
  
      return LineString.fromLngLats(slice);
    }