@Override
  public List<String> detect(ClassLoader classLoader) {
    List<File> classpathContents =
        classGraph
            .disableNestedJarScanning()
            .addClassLoader(classLoader)
            .scan(1)
            .getClasspathFiles();

    return classpathContents.stream().map(File::getAbsolutePath).collect(Collectors.toList());
  }
@Test
  public void shouldDetectResourcesInOrderTheyAppearInURLClassLoader() throws Exception {
    File file1 = createTestTmpJarFile("test1");
    File file2 = createTestTmpJarFile("test2");
    ClassLoader classLoader =
        new URLClassLoader(new URL[] {file1.toURI().toURL(), file2.toURI().toURL()});

    ClasspathScanningResourcesDetector detector =
        new ClasspathScanningResourcesDetector(new ClassGraph());

    List<String> result = detector.detect(classLoader);

    assertThat(
        result,
        containsInRelativeOrder(
            containsString(file1.getCanonicalPath()), containsString(file2.getCanonicalPath())));
  }