	@Test
	public void mergeTracks() {

		final GPX gpx = nextGPX(new Random(1)).toBuilder()
			.addTrack(nextTrack(new Random(2)))
			.addTrack(nextTrack(new Random(3)))
			.addTrack(nextTrack(new Random(4)))
			.build();

		final GPX merged = gpx.toBuilder()
			.trackFilter()
				.listMap(Filters::mergeTracks)
				.filter(Track::nonEmpty)
				.build()
			.build();

		Assert.assertEquals(merged.getTracks().size(), 1);

		final int segments = merged.getTracks().stream()
			.mapToInt(t -> t.getSegments().size())
			.sum();

		Assert.assertEquals(segments, 38);
	}