groovy Find the first element matching a condition


Example

def lst = [10, 20, 30, 40]

lst.find { it > 25 } // 30. Note: it returns a single value