protected void tryToAdd(FetchEmitTuple p) throws InterruptedException, TimeoutException {
        added++;
        boolean offered = queue.offer(p, maxWaitMs, TimeUnit.MILLISECONDS);
        if (!offered) {
            throw new TimeoutException("timed out while offering");
        }
    }
Abstract class that handles the testing for timeouts/thread safety
issues.  Concrete classes implement the blocking {@link #enqueue()}.
If there's an exception in the enqueuing thread, this will throw
a RuntimeException.  It will throw an IllegalStateException if
next() is called after hasNext() has returned false.
tika-core/src/main/java/org/apache/tika/pipes/pipesiterator/PipesIterator.java