scala> // forall() #359 scala> val data = List(1, 2, 3, 4, 4, 5, 5, 6) data: List[Int] = List(1, 2, 3, 4, 4, 5, 5, 6) scala> val res = data.forall(_ <= 7) res: Boolean = true scala> val res = data.forall(_ <= 5) res: Boolean = false scala> scala> // exists() scala> val data = List(1, 2, 3, 4, 4, 5, 5, 6) data: List[Int] = List(1, 2, 3, 4, 4, 5, 5, 6) scala> val res = data.exists(_ <= 7) res: Boolean = true scala> val res = data.forall(_ >= 7) res: Boolean = false