Created
January 30, 2014 21:55
-
-
Save danieldbower/8720760 to your computer and use it in GitHub Desktop.
Groovy retainAll example with Closure
This file contains hidden or 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
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