size

The size of this map.


Calling from Kotlin

Here's an example of calling this property from Kotlin code:

val map: NotEmptyMap<Char, Int> = notEmptyMapOf('a' to 1, 'b' to 2)
val actual: StrictlyPositiveInt = map.size
val expected: StrictlyPositiveInt = 2.toStrictlyPositiveInt()
.getOrThrow()
assertEquals(expected, actual)