 <a href="-not-empty-set/index.html">NotEmptySet</a> containing all the elements of this collection, or throws an <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/index.html">IllegalArgumentException</a> if this collection is <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/is-empty.html">empty</a>.</p><div class="sample-container"><pre><code class="block lang-kotlin" theme="idea">var collection: Collection&lt;Int&gt; = setOf(1, 2, 