From 7510492ef6ac86acc32bd130711188f5232a8a51 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 24 May 2017 19:14:41 +0200 Subject: [PATCH] Add test for iterables extension methods --- .../kotlin/net/pterodactylus/sone/utils/IterablesTest.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/kotlin/net/pterodactylus/sone/utils/IterablesTest.kt 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)) + } + +} -- 2.7.4