@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 shouldStillDetectResourcesEvenIfClassloaderIsUseless() {
    ClassLoader uselessClassLoader = Mockito.mock(ClassLoader.class);
    ClasspathScanningResourcesDetector detector =
        new ClasspathScanningResourcesDetector(new ClassGraph());

    List<String> detectedResources = detector.detect(uselessClassLoader);

    assertFalse(detectedResources.isEmpty());
  }