public static void close(Iterator<?> it) throws Exception {
        if (it == null) {
            return;
        }
        if (it instanceof CloseableIterator<?>) {
            ((CloseableIterator<?>) it).close();
        }
    }