### Question:
ConcurrentQ { public void offer(Iterator<I> iterator) throws InterruptedException { lock.lockInterruptibly(); try { while (iterator.hasNext()) { I next = iterator.next(); if (!queue.offer(next)) { tracker.waitForNext(); queue.offer(next); } tracker.itemsAdded(1); fillOpenProcessingSlots(); } } finally { lock.unlock(); } } ConcurrentQ(String name, QCallback<I, R> callback);  ConcurrentQ(QCallback<I, R> callback, Queue<I> queue, GThreadPool threadPool,
			QItemListener<I, R> listener, boolean collectResults, int maxInProgress,
			boolean jobsReportProgress); synchronized void addProgressListener(QProgressListener<I> listener); synchronized void removeProgressListener(QProgressListener<I> listener); void setMonitor(TaskMonitor monitor, boolean cancelClearsAllItems); void add(Collection<I> items); void add(Iterator<I> iterator); void offer(Iterator<I> iterator); void add(I item); boolean isEmpty(); Collection<QResult<I, R>> waitForResults(); QResult<I, R> waitForNextResult(); void waitUntilDone(); Collection<QResult<I, R>> waitForResults(long timeout, TimeUnit unit); List<I> cancelAllTasks(boolean interruptRunningTasks); List<I> removeUnscheduledJobs(); void cancelScheduledJobs(); void dispose(); boolean waitUntilDone(long timeout, TimeUnit unit);  }### Answer:
@Test public void testOffer() throws Exception { LinkedBlockingQueue<TestItem> queue = new LinkedBlockingQueue<>(1); threadPool = GThreadPool.getSharedThreadPool(TEST_THREAD_POOL); threadPool.setMaxThreadCount(2); ConcurrentQBuilder<TestItem, TestResult > builder = new ConcurrentQBuilder<>(); q = builder.setThreadPool(threadPool). setMonitor(monitor). setQueue(queue). build(callback); List<TestItem> workList = new ArrayList<>(); StartStopTestItem one = new StartStopTestItem("1", FAST_EXECUTION); workList.add(one); StartStopTestItem two = new StartStopTestItem("2", FAST_EXECUTION); workList.add(two); StartStopTestItem three = new StartStopTestItem("3", FAST_EXECUTION); workList.add(three); StartStopTestItem four = new StartStopTestItem("4", FAST_EXECUTION); workList.add(four); OfferThread offerThread = new OfferThread(workList.iterator(), false); offerThread.start(); waitForStarted(one, two); assertNotFinished(one, two); assertNotStarted(three, four); release(one); assertFinished(one); assertStarted(two, three); assertNotFinished(two, three); assertNotStarted(four); release(two); assertFinished(two); assertStarted(three, four); assertNotFinished(three, four); release(three); assertFinished(three); assertNotFinished(four); release(four); assertFinished(four); offerThread.join(2000); assertTrue(offerThread.finished()); }