code: public static <F, T> CloseableIterator<T> transform(final Iterator<F> iterator, final Function<F, T> conversion) {
          if(iterator instanceof CloseableIterator) {
              final CloseableIterator<F> iter = (CloseableIterator<F>)iterator;
              return new CloseableIterator<T>() {
                  @Override
                  public void close() {
                      iter.close();
                  }
  
                  @Override
                  public boolean hasNext() {
                      return iter.hasNext();
                  }
  
                  @Override
                  public T next() {
                      return conversion.apply(iter.next());
                  }
  
                  @Override
                  public void remove() {
                      iter.remove();
                  }
              };
          } else {
              return new CloseableIterator<T>() {
                  @Override
                  public void close() {}
  
                  @Override
                  public boolean hasNext() {
                      return iterator.hasNext();
                  }
  
                  @Override
                  public T next() {
                      return conversion.apply(iterator.next());
                  }
  
                  @Override
                  public void remove() {
                      iterator.remove();
                  }
              };
          }
      }
docs: Creates a {@link com.merakianalytics.datapipelines.iterators.CloseableIterator} which applies the provided conversion to each element as they are
  returned
  
  @param <F>
  the type of the {@link java.util.Iterator}
  @param <T>
  the type of the resulting {@link com.merakianalytics.datapipelines.iterators.CloseableIterator}
  @param iterator
  the {@link java.util.Iterator} to wrap in the transforming {@link com.merakianalytics.datapipelines.iterators.CloseableIterator}
  @param conversion
  the conversion to apply to each element
  @return a {@link com.merakianalytics.datapipelines.iterators.CloseableIterator} which transforms the elements of the provided {@link java.util.Iterator}
  as they are requested