public <T> List<Class<? extends T>> loadClasses(String descriptorPath, Class<T> baseClass) {
    Map<String, URL> discoveredClasses = new HashMap<>();
    List<Class<? extends T>> extClasses = new ArrayList<>();
    for (URL url : locateDescriptors(descriptorPath)) {
      for (String className : readDescriptor(url)) {
        if (discoveredClasses.containsKey(className)) {
          throw new ExtensionException("Duplicated Extension declaration for [%s]\nSource 1: %s\nSource 2: %s\n" +
            "This is most likely caused by having two different version of a library on the classpath."
          ).withArgs(className, url, discoveredClasses.get(className));
        }
        discoveredClasses.put(className, url);
        extClasses.add(loadExtensionClass(className, baseClass));
      }
    }
    return extClasses;
  }
Scans class path for extension descriptors and loads the extension classes specified therein.
spock-core/src/main/java/org/spockframework/runtime/ExtensionClassesLoader.java