private List<SpecInfo> collectSpecHierarchy(Supplier<SpecInfo> start, Function<SpecInfo, SpecInfo> next) {
    List<SpecInfo> specs = new ArrayList<>();
    SpecInfo curr = start.get();
    while (curr != null) {
      specs.add(curr);
      curr = next.apply(curr);
    }
    return specs;
  }
Runtime information about a Spock specification.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/runtime/model/SpecInfo.java