A function type can take zero, one, or several parameters.

Things start to get a bit complicated from a generics standpoint. Use a comma-delimited list of types to declare the types used by the function (e.g., <K, V, T>).

Here, collectify() converts a Map into a List, iterating over the map pairs and using a supplied transform function type to convert the pair into a single value for the list.

You can learn more about this in:
Run Edit