scala> // filter() #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.filter(_ < 4) res: List[Int] = List(1, 2, 3) scala> scala> // partition() scala> // Returns pair of list 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.partition(_ < 4) res: (List[Int], List[Int]) = (List(1, 2, 3),List(4, 4, 5, 5, 6)) scala> scala> // find() : Returns Option...ie Some/None #360 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.find(_ > 3) res: Option[Int] = Some(4) scala> scala> // takeWhile() 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.takeWhile(_ < 5) res: List[Int] = List(1, 2, 3, 4, 4) scala> scala> // dropWhile() 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.dropWhile(_ < 5) res: List[Int] = List(5, 5, 6) scala> scala> // span() 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.span(_ < 5) res: (List[Int], List[Int]) = (List(1, 2, 3, 4, 4),List(5, 5, 6))