Case class, list and foreach