code: public static List<TrackSegment> mergeSegments(
  		final List<TrackSegment> segments
  	) {
  		final List<WayPoint> points = segments.stream()
  			.flatMap(TrackSegment::points)
  			.collect(Collectors.toList());
  
  		return Collections.singletonList(TrackSegment.of(points));
  	}
docs: Merges the given segments into one segment containing all way-points. The
  order of the way-points is preserved.
  <pre>{@code
  final GPX merged = gpx.toBuilder()
  .trackFilter()
  .map(track -> track.toBuilder()
  .listMap(Filters::mergeSegments)
  .filter(TrackSegment::nonEmpty)
  .build())
  .build()
  .build();
  }</pre>
  
  @param segments the segment list to merge
  @return a list with one segment, containing all way-points of the original
  segments
  @throws NullPointerException if the given segment list is {@code null}