public <T extends Throwable> T thrown(Class<T> type) {
    throw new InvalidSpecException(
        "Exception conditions are only allowed in 'then' blocks, and may not be nested inside other elements");
  }
Specifies that the preceding <tt>when</tt> block should throw an exception
of the given type. May only occur in a <tt>then</tt> block.
<p>This form of exception condition is typically used if the thrown
exception instance is <em>not</em> used in subsequent conditions.

<p>Example:
<pre>
when:
"".charAt(0)

then:
thrown(IndexOutOfBoundsException)

@param type the expected exception type
@param <T> the expected exception type
@return the thrown exception instance
spock-core/src/main/java/spock/lang/Specification.java