private void setCount() {
    if (count == null) return;

    if (count instanceof RangeExpression) {
      RangeExpression range = (RangeExpression)count;
      call(resources.getAstNodeCache().InteractionBuilder_SetRangeCount,
        range.getFrom(),
        range.getTo(),
        primitiveConstExpression(range.isInclusive()));

      return;
    }

    call(resources.getAstNodeCache().InteractionBuilder_SetFixedCount, count);
  }
If the given statement is a valid interaction definition, returns the rewritten statement.
If the given statement is not an interaction definition, returns null.
If the given statement is an invalid interaction definition, records a compile error
and returns null.
spock-core/src/main/java/org/spockframework/compiler/InteractionRewriter.java