public void removeTemplateNamed(CaseInsensitiveString name) {
        PipelineTemplateConfig toBeRemoved = null;
        for (PipelineTemplateConfig templateConfig : this) {
            if (templateConfig.matches(name)) {
                toBeRemoved = templateConfig;
            }
        }
        this.remove(toBeRemoved);
    }
@Test
    public void shouldRemoveATemplateByName() {
        PipelineTemplateConfig template2 = template("template2");
        TemplatesConfig templates = new TemplatesConfig(template("template1"), template2);

        templates.removeTemplateNamed(new CaseInsensitiveString("template1"));

        assertThat(templates.size(), is(1));
        assertThat(templates.get(0), is(template2));
    }