diff --git a/common/src/main/kotlin/org/amshove/kluent/Collections.kt b/common/src/main/kotlin/org/amshove/kluent/Collections.kt index 1a7d55c..06569c9 100644 --- a/common/src/main/kotlin/org/amshove/kluent/Collections.kt +++ b/common/src/main/kotlin/org/amshove/kluent/Collections.kt @@ -847,9 +847,7 @@ infix fun > I.shouldContainNone(expected: Array): I = infix fun > I.shouldContainNone(check: (T) -> Boolean): I = apply { val result = this.map { it to check.invoke(it) } - if (result.none { it.second }) { - Unit - } else { + if (result.any { it.second }) { val failedItems = result .filterNot { it.second } .map { it.first } @@ -902,9 +900,7 @@ infix fun > I.shouldNotContainAny(expected: Array): I = infix fun > I.shouldNotContainAny(check: (T) -> Boolean): I = apply { val result = this.map { it to check.invoke(it) } - if (result.none { it.second }) { - Unit - } else { + if (result.any { it.second }) { val failedItems = result .filterNot { it.second } .map { it.first }