package com.sweetzpot.tcxzpot;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Track implements TCXSerializable {

    public static Track trackWith(Trackpoint... trackpoints) {
        return new Track(trackpoints);
    }

    public static Track trackWith(List<Trackpoint> trackpoints) {
        return new Track(trackpoints);
    }

    private List<Trackpoint> trackpoints = new ArrayList<>();

    public Track() {}

    public Track(List<Trackpoint> trackpoints) {
        this.trackpoints = new ArrayList<>(trackpoints);
    }

    public Track(Trackpoint... trackpoints) {
        Collections.addAll(this.trackpoints, trackpoints);
    }

    public void add(Trackpoint trackpoint) {
        trackpoints.add(trackpoint);
    }

    @Override
    public void serialize(Serializer serializer) {
        serializer.print("<Track>");
        for(Trackpoint trackpoint : trackpoints) {
            trackpoint.serialize(serializer);
        }
        serializer.print("</Track>");
    }
}

@@ -25,16 +25,74 @@
 xzpot;%0A%0A
+import com.sweetzpot.tcxzpot.builders.TrackpointBuilder;%0A%0A
 import j
@@ -431,24 +431,323 @@
 ts);%0A    %7D%0A%0A
+    public static Track trackWith(TrackpointBuilder... trackpointBuilders) %7B%0A        List%3CTrackpoint%3E trackpoints = new ArrayList%3C%3E();%0A        for(TrackpointBuilder builder : trackpointBuilders) %7B%0A            trackpoints.add(builder.build());%0A        %7D%0A        return new Track(trackpoints);%0A    %7D%0A%0A
     private 

Add convenience factory method