code: static <T> CloseableIterator<T> wrap(final Iterator<T> iterator, final AutoCloseable closeable) {
          return new CloseableIterator<T>() {
  
              @Override
              public void close() {
                  try {
                      closeable.close();
                  } catch (RuntimeException re) {
                      throw re;
                  } catch (Exception e) {
                      throw new IllegalStateException(e);
                  }
              }
  
              @Override
              public boolean hasNext() {
                  return iterator.hasNext();
              }
  
              @Override
              public T next() {
                  return iterator.next();
              }
  
              @Override
              public void remove() {
                  iterator.remove();
              }
          };
      }
docs: Creates a {@link CloseableIterable} from a standard iterable, while closing the provided
  closeable.
  <p/>
  Intentionally left package private.