NonBlockingQueue implements IQueue<T> { @Override public T take() throws InterruptedException { throw new UnsupportedOperationException("Blocking take operation is not supported."); } NonBlockingQueue(final Queue<T> queue); @Override void put(final T item); @Override T take(); @Override T tryTake(); @Override void addNewItemCallback(final Runnable callback); @Override void removeNewItemCallback(final Runnable callback);  }
@Test(expected = UnsupportedOperationException.class) public void Should_takeNotBeSupported() throws Exception { Queue underlying = mock(Queue.class); IQueue queue = new NonBlockingQueue(underlying); queue.take(); }