Merge "diagnostic with Java 8" tests with general diagnostic tests

This commit is contained in:
Alexander Udalov
2017-08-01 10:49:08 -07:00
parent 8db736e2b4
commit 770441c212
70 changed files with 346 additions and 458 deletions
@@ -0,0 +1,9 @@
// FULL_JDK
import java.util.*
import java.util.stream.Stream
fun <T> Stream<T>?.getIfSingle() =
this?.map { Optional.ofNullable(it) }
?.reduce(Optional.empty()) { _, _ -> Optional.empty() }
?.orElse(null) // <<---- should not be an error