Internally you're almost implementing asList also, since in one branch you create a single element list to create the set. I wonder what's the more fundamental operation and why Set is specially added to the API here. Here's a though: what if Optional implements Iterable, then you could write `new Set.from(optional)` or `new List.from(optional)`, and `transform` would naturally become `map`, `single`, `first`, and `last` would throw if the value is absent, etc.