Skip to content

Instantly share code, notes, and snippets.

@yurique
Created August 22, 2012 16:09
Show Gist options
  • Save yurique/3427085 to your computer and use it in GitHub Desktop.
Save yurique/3427085 to your computer and use it in GitHub Desktop.
scala version
class Person(var firstName: String, var lastName: String, var address: Address) {
def this() = this(null, null, null)
}
class Address(var city: String, var street: String) {
def this() = this(null, null)
}
val persons = getAListSomewhere();
val filtered = persons.filter(_.address.city == "Kyiv")
val adresses = persons.map(_.address).toSet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment