toNotEmptySetOrThrow

@SinceKotools(project = Project.Types, version = "3.2", stability = StabilityLevel.Alpha)
fun <E> Array<E>.toNotEmptySetOrThrow(): NotEmptySet<E>

Returns a NotEmptySet containing all the elements of this array, or throws an IllegalArgumentException if this array is empty.

@SinceKotools(project = Project.Types, version = "3.2", stability = StabilityLevel.Alpha)
fun <E> Collection<E>.toNotEmptySetOrThrow(): NotEmptySet<E>

Returns a NotEmptySet containing all the elements of this collection, or throws an IllegalArgumentException if this collection is empty.