@Override
    public Boolean isUsedInFetchArtifact(PipelineConfig pipelineConfig) {
        List<FetchTask> fetchTasks = pipelineConfig.getFetchTasks();
        for (FetchTask fetchTask : fetchTasks) {
            if (pipelineName.equals(fetchTask.getDirectParentInAncestorPath()))
                return true;
        }
        return false;
    }
@Test
    void shouldDetectDependencyMaterialNotUsedInFetchArtifact() {
        DependencyMaterial material = new DependencyMaterial(new CaseInsensitiveString("pipeline-foo"), new CaseInsensitiveString("stage-bar"));
        PipelineConfig pipelineConfig = mock(PipelineConfig.class);
        ArrayList<FetchTask> fetchTasks = new ArrayList<>();
        fetchTasks.add(new FetchTask(new CaseInsensitiveString("something"), new CaseInsensitiveString("new"), "src", "dest"));
        fetchTasks.add(new FetchTask(new CaseInsensitiveString("another"), new CaseInsensitiveString("boo"), new CaseInsensitiveString("foo"), "src", "dest"));
        when(pipelineConfig.getFetchTasks()).thenReturn(fetchTasks);

        assertThat(material.isUsedInFetchArtifact(pipelineConfig)).isFalse();
    }