### Question:
BlockingMpscQueue extends MpscArrayQueue<T> implements BlockingQueue<T> { @Override public boolean offer(T e, long timeout, TimeUnit unit) throws InterruptedException { long absoluteEndTime = System.nanoTime() + unit.toNanos(timeout); while (!this.relaxedOffer(e)) { if (System.nanoTime() > absoluteEndTime) { return false; } if (Thread.interrupted()) { throw new InterruptedException(); } } return true; } BlockingMpscQueue(int size); @Override void put(T e); @Override boolean offer(T e, long timeout, TimeUnit unit); @Override T take(); @Override T poll(long timeout, TimeUnit unit); @Override int remainingCapacity(); @Override int drainTo(Collection<? super T> c); @Override int drainTo(Collection<? super T> c, int maxElements);  }### Answer:
@Test public void testOffer() throws Exception { final int size = 16; BlockingQueue<Integer> queue = new BlockingMpscQueue<>(size); for (int i = 0; i < size; i++) { assertTrue(queue.offer(1, 100, TimeUnit.MILLISECONDS)); } assertEquals(size, queue.size()); assertFalse(queue.offer(1, 100, TimeUnit.MILLISECONDS)); assertEquals(size, queue.size()); }