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 testDetectsResourcesToStage() throws IOException {
    File file = tmpFolder.newFile("file");
    URLClassLoader classLoader = new URLClassLoader(new URL[] {file.toURI().toURL()});
    PipelineResourcesOptions options =
        PipelineOptionsFactory.create().as(PipelineResourcesOptions.class);

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

    assertThat(detectedResources, not(empty()));
  }