Skip to content

Instantly share code, notes, and snippets.

@aruld

aruld/gist:8158277

Last active Jan 1, 2016
Embed
What would you like to do?
def static void main(String[] args) {
val employees = Arrays.asList("neal", "s", "stu", "j", "rich", "bob")
val result = employees.stream
.filter[length() > 1]
.map[toFirstUpper()]
.reduce[x, y | x + "," + y]
}
// without map()
def static void main(String[] args) {
val employees = Arrays.asList("neal", "s", "stu", "j", "rich", "bob")
val result = employees.stream
.filter[length() > 1]
.reduce[x, y | x.toFirstUpper + "," + y.toFirstUpper]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.