Here you can find the source of closeIterator(Iterator> iterator)
public static void closeIterator(Iterator<?> iterator)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; public class Main { /**/*from w w w .j a v a2 s. c om*/ * Closes an iterator if it has interface ClosableIterator. This is useful * to avoid open iterator warnings when we're not interested in all results * of a sparql query. */ public static void closeIterator(Iterator<?> iterator) { while (iterator.hasNext()) { iterator.next(); } } }