private Stream<? extends AnnotationNode> flattenRepeatableExtensionAnnotationContainer(AnnotationNode container) {
    // supply the container itself, it could also be a valid extension annotation
    Stream<? extends AnnotationNode> result = Stream.of(container);

    Expression value = container.getMember("value");
    if (value instanceof ListExpression) {
      List<Expression> valueExpressions = asInstance(value, ListExpression.class).getExpressions();
      switch (valueExpressions.size()) {
        case 0:
          // no value, nothing to do
          break;

        case 1:
          result = handleSingleContainedAnnotation(container, result, valueExpressions.get(0));
          break;

        default:
          result = handleMultipleContainedAnnotations(container, result, valueExpressions);
          break;
      }
    } else if (value instanceof AnnotationConstantExpression) {
      result = handleSingleContainedAnnotation(container, result, value);
    }

    return result;
  }
Puts all spec information required at runtime into annotations
attached to class members.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/compiler/SpecAnnotator.java