docs: private List<Trip.Leg> parsePathIntoLegs(List<Label.Transition> path, Graph graph, Weighting weighting, Translation tr) {
          if (path.size() <= 1) {
              return Collections.emptyList();
          }
          if (GtfsStorage.EdgeType.ENTER_PT == path.get(1).edge.edgeType) {
              final GtfsStorage.FeedIdWithTimezone feedIdWithTimezone = gtfsStorage.getTimeZones().get(path.get(2).edge.timeZoneId);
              List<Trip.Leg> result = new ArrayList<>();
              long boardTime = -1;
              List<Label.Transition> partition = null;
              for (int i = 1; i < path.size(); i++) {
                  Label.Transition transition = path.get(i);
                  Label.EdgeLabel edge = path.get(i).edge;
                  if (edge.edgeType == GtfsStorage.EdgeType.BOARD) {
                      boardTime = transition.label.currentTime;
                      partition = new ArrayList<>();
                  }
                  if (partition != null) {
                      partition.add(path.get(i));
                  }
                  if (EnumSet.of(GtfsStorage.EdgeType.TRANSFER, GtfsStorage.EdgeType.LEAVE_TIME_EXPANDED_NETWORK).contains(edge.edgeType)) {
                      Geometry lineString = lineStringFromEdges(partition);
                      GtfsRealtime.TripDescriptor tripDescriptor;
                      try {
                          tripDescriptor = GtfsRealtime.TripDescriptor.parseFrom(realtimeFeed.getTripDescriptor(partition.get(0).edge.edgeIteratorState.getEdge()));
                      } catch (InvalidProtocolBufferException e) {
                          throw new RuntimeException(e);
                      }
                      final StopsFromBoardHopDwellEdges stopsFromBoardHopDwellEdges = new StopsFromBoardHopDwellEdges(feedIdWithTimezone.feedId, tripDescriptor);
                      partition.stream()
                              .filter(e -> EnumSet.of(GtfsStorage.EdgeType.HOP, GtfsStorage.EdgeType.BOARD, GtfsStorage.EdgeType.DWELL).contains(e.edge.edgeType))
                              .forEach(stopsFromBoardHopDwellEdges::next);
                      stopsFromBoardHopDwellEdges.finish();
                      List<Trip.Stop> stops = stopsFromBoardHopDwellEdges.stops;
  
                      result.add(new Trip.PtLeg(
                              feedIdWithTimezone.feedId, partition.get(0).edge.nTransfers == 0,
                              tripDescriptor.getTripId(),
                              tripDescriptor.getRouteId(),
                              edges(partition).map(edgeLabel -> edgeLabel.edgeIteratorState).collect(Collectors.toList()).get(0).getName(),
                              stops,
                              partition.stream().mapToDouble(t -> t.edge.distance).sum(),
                              path.get(i - 1).label.currentTime - boardTime,
                              lineString));
                      partition = null;
                  }
              }
              return result;
          } else {
              InstructionList instructions = new InstructionList(tr);
              InstructionsFromEdges instructionsFromEdges = new InstructionsFromEdges(path.get(1).edge.edgeIteratorState.getBaseNode(), graph,
                      weighting, weighting.getFlagEncoder(), weighting.getFlagEncoder().getBooleanEncodedValue(EncodingManager.ROUNDABOUT), graph.getNodeAccess(), tr, instructions);
              int prevEdgeId = -1;
              for (int i = 1; i < path.size(); i++) {
                  if (path.get(i).edge.edgeType != GtfsStorage.EdgeType.HIGHWAY) {
                      throw new IllegalStateException("Got a transit edge where I think I must be on a road.");
                  }
                  EdgeIteratorState edge = path.get(i).edge.edgeIteratorState;
                  instructionsFromEdges.next(edge, i, prevEdgeId);
                  prevEdgeId = edge.getEdge();
              }
              instructionsFromEdges.finish();
              final Instant departureTime = Instant.ofEpochMilli(path.get(0).label.currentTime);
              final Instant arrivalTime = Instant.ofEpochMilli(path.get(path.size() - 1).label.currentTime);
              return Collections.singletonList(new Trip.WalkLeg(
                      "Walk",
                      Date.from(departureTime),
                      lineStringFromEdges(path),
                      edges(path).mapToDouble(edgeLabel -> edgeLabel.distance).sum(),
                      instructions,
                      Date.from(arrivalTime)));
          }
      }