Groovy web console

subscribe to the feed Subscribe
to this
site
Unique (via #groovywebconsole)
tweet this snippet Tweet
this
script

Unique

Published 1 month ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def x = [
[id:"visa",type:"CREDIT_CARD",name:"visa",issuer:1213],
[id:"master",type:"CREDIT_CARD",name:"master",issuer:1223],
[id:"master",type:"CREDIT_CARD",name:"master",issuer:1224],
[id:"amex",type:"DEBIT_CARD",name:"visa",issuer:12233],
[id:"amex",type:"DEBIT_CARD",name:"visa",issuer:4444]
]

def filterX = x.findAll{
    it.type == "CREDIT_CARD" 
}

filterX.unique {it.id}