Filter function

The Filter function is a HOF that takes another HOF, namely ByMake, and performs a data transformation.

func (cars Collection) Filter(fn FilterFunc) Collection {
filteredCars := make(Collection, 0)
for _, car := range cars {
if fn(car) {
filteredCars = append(filteredCars, car)
}
}
return filteredCars
}