Generics for Closeable iterators