private static <T extends Annotation> List<T> collectAnnotationRecursive(Class<?> cls, Class<T> annotationClass,
                                                                           List<T> result) {
    T annotation = cls.getAnnotation(annotationClass);
    if (annotation != null) {
      result.add(annotation);
    }
    if (Object.class.equals(cls)) return result;
    return collectAnnotationRecursive(cls.getSuperclass(), annotationClass, result);
  }
Returns the resources from the {@code Thread.currentThread().getContextClassLoader()}.

@param resourcePath the path of the resource
@return the list of resources
@throws IOException if the resources can't be loaded
spock-core/src/main/java/org/spockframework/util/ReflectionUtil.java