of
@ExperimentalSince(version = KotoolsTypesVersion.V4_5_0)
Creates a NotEmptyList starting with a head and containing all the elements of the optional tail.
Calling from Kotlin
Here's an example of calling this method from Kotlin code:
val integers: NotEmptyList<Int> = NotEmptyList.of(1, 2, 3)
assertEquals(expected = "[1, 2, 3]", actual = "$integers")
Content copied to clipboard
The NotEmptyList type being an inline value class, this method is not available yet for Java users.