private void doRunAnnotationDrivenExtensions(NodeInfo<?, ?> node) {
    RepeatedExtensionAnnotations repeatedExtensionAnnotations = node.getAnnotation(RepeatedExtensionAnnotations.class);

    List<List<Annotation>> annotations;
    if (repeatedExtensionAnnotations == null) {
      annotations = Arrays
        .stream(node.getAnnotations())
        .map(Collections::singletonList)
        .collect(toList());
    } else {
      annotations = new ArrayList<>();
      List<Class<? extends Annotation>> repeatedAnnotations = asList(repeatedExtensionAnnotations.value());

      // add all direct annotations except those marked as repeated
      Arrays.stream(node.getAnnotations())
        .filter(annotation -> repeatedAnnotations
          .stream()
          .noneMatch(repeatedAnnotation -> repeatedAnnotation.isInstance(annotation)))
        .map(Collections::singletonList)
        .forEach(annotations::add);

      // add all annotations marked as repeated
      for (Class<? extends Annotation> repeatedAnnotation : repeatedAnnotations) {
        annotations.add(asList(node.getAnnotationsByType(repeatedAnnotation)));
      }
    }

    doRunAnnotationDrivenExtensions(node, annotations);
    doRunAnnotationDrivenExtensionsForParameters(node);
  }
Runs global and local extensions for a spec.
spock-core/src/main/java/org/spockframework/runtime/ExtensionRunner.java