class CheckedIterator {

    @NonNull
    public <NEW> CheckedIterator<NEW, T> transform(@NonNull final Function<? super E, ? extends NEW> function) {
        requireNonNull(function);
        final CheckedIterator<E, T> iterator = this;
        return new CheckedIterator<NEW, T>() {
            @Override
            public boolean hasNext() throws T {
                return iterator.hasNext();
            }

            @Override
            public NEW next() throws T, NoSuchElementException {
                return function.apply(iterator.next());
            }
        };
    }

}