public <T> void resolve(T resolvable) {
        ParamResolver resolver = this;
        if (ParamScope.class.isAssignableFrom(resolvable.getClass())) {
            ParamScope newScope = (ParamScope) resolvable;
            resolver = newScope.applyOver(resolver);
        }
        resolveStringLeaves(resolvable, resolver);
        resolveNonStringLeaves(resolvable, resolver);
        resolveNodes(resolvable, resolver);
    }
@Test
    public void shouldNotRecursivelySubstituteParams() {
        PipelineConfig pipelineConfig = PipelineConfigMother.createPipelineConfig("cruise", "dev", "ant");

        pipelineConfig.setLabelTemplate("#{foo}");

        new ParamResolver(new ParamSubstitutionHandlerFactory(params(param("foo", "#{bar}"), param("bar", "baz"))), fieldCache).resolve(pipelineConfig);
        assertThat(pipelineConfig.getLabelTemplate(), is("#{bar}"));

        pipelineConfig.setLabelTemplate("#{foo}");

        new ParamResolver(new ParamSubstitutionHandlerFactory(params(param("foo", "###"))), fieldCache).resolve(pipelineConfig);
        assertThat(pipelineConfig.getLabelTemplate(), is("###"));
    }