public ParamsConfig referredParams() {
        ParamReferenceCollectorFactory paramHandlerFactory = new ParamReferenceCollectorFactory();
        new ParamResolver(paramHandlerFactory, FIELD_CACHE).resolve(CLONER.deepClone(this));
        ParamsConfig paramsConfig = new ParamsConfig();
        for (String param : paramHandlerFactory.referredParams()) {
            paramsConfig.add(new ParamConfig(param, null));
        }
        return paramsConfig;
    }
@Test
    public void shouldUnderstandUsedParams() {
        PipelineTemplateConfig template = PipelineTemplateConfigMother.createTemplateWithParams("template-name", "foo", "bar", "baz");
        ParamsConfig params = template.referredParams();
        assertThat(params.size(), is(3));
        assertThat(params, hasItem(new ParamConfig("foo", null)));
        assertThat(params, hasItem(new ParamConfig("bar", null)));
        assertThat(params, hasItem(new ParamConfig("baz", null)));
        params = template.referredParams();//should not mutate
        assertThat(params.size(), is(3));
    }