/**
 * Given a list of elements and a boolean function, returns a new list that contains only the elements where
 * the function returns True.
 *
 * @param selection List of elements.
 * @param function Boolean function.
 * @return New list containing only the elements for which the function returns True.
 */
fun intersection(selection: List<Int>, function: (Int) -> Boolean): List<Int> {

    return selection.filter { function(it) }
}
/**
 * Given a list of elements and a boolean function, returns a new list that contains only the elements where
 * the function returns True.
 *
 * @param selection List of elements.
 * @param function Boolean function.
 * @return New list containing only the elements for which the function returns True.
 */
fun intersection(selection: List<Int>, function: (Int) -> Boolean): List<Int> {
/**
 * Given a list of elements and a boolean function, returns a new list that contains only the elements where
 * the function returns True.
 *
 * @param selection List of elements.
 * @param function Boolean function.
 * @return New list containing only the elements for which the function returns True.
 */
fun intersection(selection: List<Int>, function: (Int) -> Boolean): List<Int> {

    return selection.filter { function(it) }
}