Skip to content

Instantly share code, notes, and snippets.

@danieldbower
Created January 30, 2014 21:55
Show Gist options
  • Save danieldbower/8720760 to your computer and use it in GitHub Desktop.
Save danieldbower/8720760 to your computer and use it in GitHub Desktop.
Groovy retainAll example with Closure
def a = [[id:"a"], [id:"b"], [id:"c"]]
def b = ["a", "b"]
a.retainAll(){
println it
b.contains(it.id)
}
println a
println b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment