void checkEmpty(BlockingQueue q) { try { assertTrue(q.isEmpty()); assertEquals(0, q.size()); assertNull(q.peek()); assertNull(q.poll()); assertNull(q.poll(0, MILLISECONDS)); assertEquals("[]", q.toString()); assertTrue(Arrays.equals(q.toArray(), new Object[0])); assertFalse(q.iterator().hasNext()); try { q.element(); shouldThrow(); } catch (NoSuchElementException success) { } try { q.iterator().next(); shouldThrow(); } catch (NoSuchElementException success) { } try { q.remove(); shouldThrow(); } catch (NoSuchElementException success) { } } catch (InterruptedException ie) { threadUnexpectedException(ie); } }
@Override public T element() { return delegate.element(); }
@Override public E element() { return localInternalQueue.element(); }