docs: public static <T> Set<T> asSet(final Iterator<T> iterator)
     {
        Set<T> result = new HashSet<T>();
        while (iterator.hasNext())
        {
           T t = iterator.next();
           result.add(t);
        }
        return result;
     }