From: David ‘Bombe’ Roden Date: Wed, 24 May 2017 17:14:41 +0000 (+0200) Subject: Add test for iterables extension methods X-Git-Tag: 0.9.7^2~206 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=7510492ef6ac86acc32bd130711188f5232a8a51 Add test for iterables extension methods --- 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 index 0000000..639dc90 --- /dev/null +++ b/src/test/kotlin/net/pterodactylus/sone/utils/IterablesTest.kt @@ -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)) + } + +}