Skip to content

Instantly share code, notes, and snippets.

@sliskiCode
Last active December 19, 2016 14:30
Show Gist options
  • Select an option

  • Save sliskiCode/b080d45cc8a54e2ac0111b004fd91186 to your computer and use it in GitHub Desktop.

Select an option

Save sliskiCode/b080d45cc8a54e2ac0111b004fd91186 to your computer and use it in GitHub Desktop.
Living (Android) without Kotlin #4
fun foo(persons: MutableList<Person>) {
persons.filter { it.age >= 21 }
.filter { it.name.startsWith("P") }
.map { it.name }
.sorted()
.forEach(::println)
}
data class Person(val name: String, val age: Int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment