kitttn
11/19/2018, 1:01 PMval customersSet = customers.collectToSet { it.phoneNumber }
which will make a set of customers with non-repeating phone numbersmarstran
11/19/2018, 1:05 PMcustomers.distinctBy { it.phoneNumber }
, but it will return a List
. You can do toSet
after to make it a set.kitttn
11/19/2018, 1:06 PMmarstran
11/19/2018, 1:06 PMReinis
11/19/2018, 2:23 PMReinis
11/19/2018, 2:23 PMReinis
11/19/2018, 2:26 PMequals
checks then it should be fine