How to write a conditional collect in groovy? February 23, 2023 by Tarik You need findAll: barsOfAllFoos.findAll { it.contains 'baz' }