public boolean validateTree(ValidationContext validationContext) {
        validate(validationContext);
        boolean isValid = errors().isEmpty();
        for (JobConfig jobConfig : this) {
            isValid = jobConfig.validateTree(validationContext) && isValid;
        }
        return isValid;
    }
@Test
    public void shouldReturnTrueIfAllDescendentsAreValid() {
        JobConfig jobConfig = mock(JobConfig.class);
        when(jobConfig.validateTree(any(PipelineConfigSaveValidationContext.class))).thenReturn(true);
        JobConfigs jobConfigs = new JobConfigs(jobConfig);

        boolean isValid = jobConfigs.validateTree(PipelineConfigSaveValidationContext.forChain(true, "group", new PipelineConfig()));
        assertTrue(isValid);

        verify(jobConfig).validateTree(any(PipelineConfigSaveValidationContext.class));
    }