static newNext(id, allPrevSegments) {
		return new CodePathSegment(
			id,
			CodePathSegment.flattenUnusedSegments(allPrevSegments),
			allPrevSegments.some(isReachable),
		);
	}
Creates a new segment and appends it after the given segments.
@param {string} id An identifier.
@param {CodePathSegment[]} allPrevSegments An array of the previous segments
     to append to.
@returns {CodePathSegment} The created segment.