code: @Beta
    public <U> void with(
      @DelegatesTo.Target
      U target,
      @DelegatesTo(strategy = Closure.DELEGATE_FIRST) @ClosureParams(FirstParam.class)
      Closure<?> closure
    ) {
      if (target == null) {
        throw new SpockAssertionError("Target of 'with' block must not be null");
      }
      closure.setDelegate(target); // for conditions
      closure.setResolveStrategy(Closure.DELEGATE_FIRST);
      GroovyRuntimeUtil.invokeClosure(closure, target);
    }
docs: Sets the specified object as the implicit target of the top-level conditions and/or
  interactions contained in the specified code block, thereby avoiding the need to repeat
  the same expression multiple times. Implicit conditions are supported. (In other words,
  the {@code assert} keyword may be omitted.) If the target is {@code null}, a
  {@code SpockAssertionError} is thrown.
  
  <p>A {@code with} block can be used anywhere in a spec, including nested positions
  and helper methods.
  
  <p>Condition example:
  
  <pre>
  def fred = new Person(name: "Fred", age: 42)
  def spaceship = new Spaceship(pilot: fred)
  
  expect:
  with(spaceship.pilot) {
  name == "Fred" // shorthand for: spaceship.pilot.name == "Fred"
  age == 42
  }
  </pre>
  
  <p> Interaction example:
  
  <pre>
  def service = Mock(Service) // has start(), stop(), and doWork() methods
  def app = new Application(service) // controls the lifecycle of the service
  
  when:
  app.run()
  
  then:
  with(service) {
  1 * start() // shorthand for: 1 * service.start()
  1 * doWork()
  1 * stop()
  }
  </pre>
  
  @param target an implicit target for conditions and/or interactions
  @param closure a code block containing top-level conditions and/or interactions
  @param <U> type of target