package iterator; public class BypassIterator { private Iterator<String> iterator; public BypassIterator(List<String> list) { iterator = list.iterator(); } public boolean Bypass() { boolean result = false; while (iterator.hasNext()) { result = ProcessItem(iterator.next()); if (result == false) { break; } } return result; } return true; } }