def filterList(lst: List[Int], predicate: Int => Boolean): List[Int] = lst.filter(predicate)
// Test
println(filterList(List(1, 2, 3, 4, 5), _ % 2 == 0)) // Should print: List(2, 4)
def mapList[A, B](lst: List[A], func: A => B): List[B] = lst.map(func)
// Test
println(mapList(List("1", "2", "3"), _.toInt)) // Should print: List(1, 2, 3)
def multiplier(factor: Int): Int => Int = number => number * factor
// Test
val triple = multiplier(3)
println(triple(5)) // Should print: 15
def sortWithFunction[A](lst: List[A], comparator: (A, A) => Boolean): List[A] = lst.sortWith(comparator)
// Test
println(sortWithFunction(List(3, 1, 4, 2), (x: Int, y: Int) => x < y)) // Should print: List(1, 2, 3, 4)