I would be even more generic and support even Iterable instead of Collection and add support to arrays.