public static List<String> detectClassPathResourcesToStage(
      ClassLoader classLoader, PipelineOptions options) {

    PipelineResourcesOptions artifactsRelatedOptions = options.as(PipelineResourcesOptions.class);
    List<String> detectedResources =
        artifactsRelatedOptions.getPipelineResourcesDetector().detect(classLoader);

    return detectedResources.stream().filter(isStageable()).collect(Collectors.toList());
  }
@Test
  public void testDetectedResourcesListDoNotContainNotStageableResources() throws IOException {
    File unstageableResource = tmpFolder.newFolder(".gradle/wrapper/unstageableResource");
    URLClassLoader classLoader =
        new URLClassLoader(new URL[] {unstageableResource.toURI().toURL()});
    PipelineResourcesOptions options =
        PipelineOptionsFactory.create().as(PipelineResourcesOptions.class);

    List<String> detectedResources =
        PipelineResources.detectClassPathResourcesToStage(classLoader, options);

    assertThat(detectedResources, not(contains(unstageableResource.getAbsolutePath())));
  }