code: public static <T> Set<T> toSet(final CloseableIterator<T> iterator) {
          final Set<T> set = new HashSet<>();
          while(iterator.hasNext()) {
              set.add(iterator.next());
          }
          iterator.close();
          return set;
      }
docs: Exhausts the {@link com.merakianalytics.datapipelines.iterators.CloseableIterator} to populate a {@link java.util.Set}. The
  {@link com.merakianalytics.datapipelines.iterators.CloseableIterator} will be closed once exhausted.
  
  @param <T>
  the type of the {@link com.merakianalytics.datapipelines.iterators.CloseableIterator}
  @param iterator
  the {@link com.merakianalytics.datapipelines.iterators.CloseableIterator} to populate the {@link java.util.Set} with
  @return a {@link java.util.Set}