private static Iterator<String> stringArrayIterator(final String[] chunks) { Iterator<String> settingIterator = new Iterator<String>() { private ResettableIterator inner = IteratorUtils.arrayIterator(chunks); @Override public String next() { return (String) inner.next(); } @Override public boolean hasNext() { return inner.hasNext(); } @Override public void remove() { inner.remove(); } }; return settingIterator; }