code: public static List<Track> mergeTracks(final List<Track> tracks) {
  		final List<TrackSegment> segments = tracks.stream()
  			.flatMap(Track::segments)
  			.collect(Collectors.toList());
  
  		return tracks.isEmpty()
  			? emptyList()
  			: singletonList(
  				tracks.get(0).toBuilder()
  					.segments(segments)
  					.build()
  				);
  	}
docs: Merges the given tracks into one track containing all segments. The order
  of the segments is preserved.
  <pre>{@code
  final GPX merged = gpx.toBuilder()
  .trackFilter()
  .listMap(Filters::mergeTracks)
  .filter(Track::nonEmpty)
  .build())
  .build();
  }</pre>
  
  @param tracks the track list to merge
  @return a list with one track, containing all segments
  @throws NullPointerException if the given track list is {@code null}