Add methods `distinct`, `map` and `group` as extensions to class `Collection`.