Last active
January 9, 2019 22:19
-
-
Save yayaa/261286ac7a315f93105f14808b98217a to your computer and use it in GitHub Desktop.
Improving the code - 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
getFruits() | |
.asSequence() | |
.filter { it.name != null } | |
.filter { !it.isRotten } | |
.filter { it.color == Color.ORANGE } | |
.forEach { println("Yay! It's an orange ${it.name}") } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment