"p">(</span><span class="nv">array</span><span class="p">:</span> <span class="p">[</span><span class="kt">UserObject</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="kt">Int</span>
<span class="p">}</span>
</code></pre>

<p>Test - usage of <code>Given</code> to specify stubbed methods return values and throws errors:</p>
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">mock</span> <span class="o">=</span> <span class="kt">ProtocolWithCustomAttributesMo