Use collect for collecting elements