package com.mjrichardson.teamCity.buildTriggers;

import java.util.ArrayList;
import java.util.Iterator;

public class OctopusDeployments implements Iterable<OctopusDeployment> {
    private ArrayList<OctopusDeployment> statusMap;

    public OctopusDeployments() {
        this.statusMap = new ArrayList<>();
    }

    public void add(OctopusDeployment octopusDeployment) {
        if (!contains(octopusDeployment.environmentId))
            statusMap.add(octopusDeployment);
    }

    public boolean contains(String octopusDeploymentId) {
        for (OctopusDeployment octopusDeployment : statusMap) {
            if (octopusDeployment.id.equals(octopusDeploymentId))
                return true;
        }
        return false;
    }

    @Override
    public Iterator<OctopusDeployment> iterator() {
        return statusMap.iterator();
    }

    public int size() {
        return statusMap.size();
    }

    public OctopusDeployment[] toArray() {
        return statusMap.toArray(new OctopusDeployment[0]);
    }
}

@@ -99,16 +99,69 @@
 rator;%0A%0A
+//todo: rename%0A//todo: move under 'Model' namespace?%0A
 public c

Add some todo comments