Intersect on ArrayList with objects groovy -


I have two array lists with items of domain category 'user'

  a = [User: 35, User: 36] User: 37] b = [user: 32, user: 33] user: 34, user: 35, user: 36, user: 37]  
< P> When I do intersection ( java.util ), it returns an empty list. How can I get general objects in the array list?

This is due to the fact that you map (with the same key in the list.

[user4: 32], user 5: 33, user 6:

34, User 1: 35, User 2: 36, User 3: 37] ActorsAct (B) == [Users 1: 35, User 2: 36, User 3: 37]

When you modify it to include the ID, it behaves as expected:

  def a = [35, 36, 37] def b = [ 32, 33, 34, 35, 36, 3 7] An underlying pointer (B) == [35,36,37]  

See this?


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -