code: public static GPX nonEmptyGPX(final GPX gpx) {
  		return gpx.toBuilder()
  			.routeFilter()
  				.listMap(Filters::nonEmptyRoutes)
  				.build()
  			.trackFilter()
  				.listMap(Filters::nonEmptyTracks)
  				.build()
  			.metadata(gpx.getMetadata()
  						.filter(Metadata::nonEmpty)
  						.orElse(null))
  			.build();
  	}
docs: Return a new {@code GPX} object with all <i>empty</i> elements (tracks,
  track-segments, routes and metadata) removed. This method can be used
  to clean up the GPX object before writing it to file.
  <pre>{@code
  final GPX gpx = ...;
  final GPX.write(Filters.nonEmptyGPX(gpx), "tracks.gpx", "    ");
  }</pre>
  
  @param gpx the GPX object to clean up
  @return a new {@code GPX} object with all <i>empty</i> elements removed
  @throws NullPointerException if the given {@code gpx} object is
  {@code null}