diff --git a/arrow-libs/core/arrow-core-test/src/commonMain/kotlin/arrow/core/test/UnitSpec.kt b/arrow-libs/core/arrow-core-test/src/commonMain/kotlin/arrow/core/test/UnitSpec.kt
index 04be368b493..3896f9f4580 100644
--- a/arrow-libs/core/arrow-core-test/src/commonMain/kotlin/arrow/core/test/UnitSpec.kt
+++ b/arrow-libs/core/arrow-core-test/src/commonMain/kotlin/arrow/core/test/UnitSpec.kt
@@ -1,22 +1,17 @@
package arrow.core.test
-import arrow.core.NonEmptyList
-import arrow.core.Tuple4
-import arrow.core.Tuple5
+import arrow.core.*
import arrow.core.test.generators.unit
import arrow.core.test.laws.Law
import io.kotest.core.names.TestName
-import io.kotest.core.source.SourceRef
-import io.kotest.core.spec.RootTest
import io.kotest.core.spec.style.StringSpec
import io.kotest.core.spec.style.scopes.StringSpecScope
import io.kotest.core.spec.style.scopes.addTest
-import io.kotest.core.test.TestType
import io.kotest.property.Arb
import io.kotest.property.Gen
import io.kotest.property.PropertyContext
import io.kotest.property.arbitrary.bind
-import io.kotest.property.arbitrary.filter
+import io.kotest.property.arbitrary.filterIsInstance
import io.kotest.property.arbitrary.map
import io.kotest.property.arbitrary.list as KList
import io.kotest.property.arbitrary.map as KMap
@@ -38,8 +33,12 @@ public abstract class UnitSpec(
public fun Arb.Companion.list(gen: Gen, range: IntRange = 0..maxDepth): Arb> =
Arb.KList(gen, range)
- public fun Arb.Companion.nonEmptyList(arb: Arb, depth: Int = maxDepth): Arb> =
- Arb.list(arb, 1..max(1, depth)).filter(List::isNotEmpty).map(NonEmptyList.Companion::fromListUnsafe)
+ public fun Arb.Companion.nonEmptyList(arb: Arb, depth: Int = maxDepth): Arb> {
+ return Arb.list(arb, 1..max(1, depth))
+ .map { Option.fromNullable(it.toNonEmptyListOrNull()) }
+ .filterIsInstance