@SuppressWarnings("UnusedDeclaration")
  public static <T> void that(T value, Matcher<? super T> matcher) {
    throw new InvalidSpecException("that() can only be used where a condition is expected");
  }
Used to match a value against a (Hamcrest) matcher.
Only allowed in places where a condition is expected
(expect-block, then-block, after an 'assert' keyword).

<p>Basic example:

<pre>
import static spock.util.matcher.HamcrestSupport.that
import static org.hamcrest.CoreMatchers.equalTo // ships with JUnit

def foo = 42

expect:
that(foo, equalTo(42))
</pre>

Note that Spock supports an even simpler syntax for applying matchers:

<pre>
expect:
foo equalTo(42)
</pre>

However, the simpler syntax cannot be used in explicit conditions
(i.e. after the 'assert' keyword), and may not be as IDE-friendly.
That's why this method is provided as an alternative.

<h3>When would I use matchers?</h3>

<p>Due to Spock's good diagnostic messages and Groovy's expressivity,
matchers are less often needed than when, say, writing JUnit tests
in Java. However, they come in handy when more complex conditions
are required (and possibly repeated throughout a project).
In such cases, Spock's Hamcrest integration provides the best of two worlds:
the diagnostic messages known from Spock's conditions, and the
custom failure messages of Hamcrest matchers.

<h3>Third-party matchers</h3>

<p>The matchers that ship with JUnit aren't very useful per se.
Instead, you will want to use matchers from Hamcrest
(https://hamcrest.org/JavaHamcrest/) or other libraries. Both Hamcrest
1.1 and 1.2 are supported. You can also write your own matchers,
building up a matcher library that's specific to the needs of your project.

@param value the actual value
@param matcher a matcher describing the expected value
@param <T> the actual value's type
spock-core/src/main/java/spock/util/matcher/HamcrestSupport.java