public <T extends Throwable> T thrown() {
    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.
May only occur as the initializer expression of a typed variable declaration
in a <tt>then</tt> block; the expected exception type is inferred from the
variable type.
<p>This form of exception condition is typically used if the thrown
exception instance is used in subsequent conditions.

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

then:
IndexOutOfBoundsException e = thrown()
e.message.contains(...)
</pre>

@return the thrown exception instance
spock-core/src/main/java/spock/lang/Specification.java