toNotEmptyListOrThrow

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

Returns a NotEmptyList 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>.toNotEmptyListOrThrow(): NotEmptyList<E>

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