Exercise 3.21: filterViaFlatMap