@Nullable
  private static Pair<Integer, Integer> findThreadSection(List<String> lines, String threadName, long threadId) {
    String lineFormat = "\"%s\" #%d";
    int threadSectionStart = -1;
    for (int i = 0; i < lines.size(); ++i) {
      if (lines.get(i).startsWith(String.format(lineFormat, threadName, threadId))) {
        threadSectionStart = i;
      } else if (threadSectionStart > 0 && lines.get(i).isEmpty()) {
        return Pair.of(threadSectionStart, i);
      }
    }

    return null;
  }
Times out a method invocation if it takes too long. The method invocation
will occur on the regular test framework thread. This can be important
for integration tests with thread-local state.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/runtime/extension/builtin/TimeoutInterceptor.java