// add vertex to successor links AND to predecessor links of successors
for (LaneSegment laneSegment : roadSegment.laneSegments()) {
if (laneSegment.sinkLaneSegment() != null) {
RoadSegment successor = laneSegment.sinkLaneSegment().roadSegment();
successor.setNode(NodeType.ORIGIN, toVertex);
for (LaneSegment laneSegmentSuccessor : successor.laneSegments()) {
if (laneSegmentSuccessor.sourceLaneSegment() != null) {
RoadSegment predecessor = laneSegmentSuccessor.sourceLaneSegment().roadSegment();
predecessor.setNode(NodeType.DESTINATION, toVertex);
}
}