added methods to create a list, set or sortedSet from an iterable and a
function