Add test for iterables extension methods
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 24 May 2017 17:14:41 +0000 (19:14 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 24 May 2017 17:14:41 +0000 (19:14 +0200)
src/test/kotlin/net/pterodactylus/sone/utils/IterablesTest.kt [new file with mode: 0644]

diff --git a/src/test/kotlin/net/pterodactylus/sone/utils/IterablesTest.kt b/src/test/kotlin/net/pterodactylus/sone/utils/IterablesTest.kt
new file mode 100644 (file)
index 0000000..639dc90
--- /dev/null
@@ -0,0 +1,16 @@
+package net.pterodactylus.sone.utils
+
+import com.google.common.base.Optional.fromNullable
+import org.hamcrest.MatcherAssert.assertThat
+import org.hamcrest.Matchers.contains
+import org.junit.Test
+
+class IterablesTest {
+
+       @Test
+       fun testMapPresent() {
+               val originalList = listOf(1, 2, null, 3, null)
+               assertThat(originalList.mapPresent { fromNullable(it) }, contains(1, 2, 3))
+       }
+
+}