### Question:
BlockingQueue { public synchronized Object dequeue() throws InterruptedException, Closed { consumers++; try { while (queue.size() == 0) { wait(); if (closed) throw new Closed(); } } finally { consumers--; } return queue.removeFirst(); }  synchronized void enqueue(Object o); synchronized void requeue(Object o); synchronized Object dequeue(); synchronized Object dequeue(long timeout); synchronized void close(); synchronized int consumerCount(); synchronized int consumerDeficit(); synchronized boolean ready(); synchronized int pending(); LinkedList getQueue(); void setQueue(LinkedList queue);  }### Answer:
@SuppressWarnings("unchecked") @Test public void testDequeue() throws Throwable { BlockingQueue blockingQueue = new BlockingQueue(); LinkedList queue = new LinkedList<Object>(); Boolean boolean2 = Boolean.TRUE; queue.add(true); queue.add(""); blockingQueue.setQueue(queue); Boolean result = (Boolean) blockingQueue.dequeue(-1L); assertSame(queue, blockingQueue.getQueue(), "blockingQueue.getQueue()"); assertFalse(boolean2.equals(blockingQueue.getQueue().get(0)), "blockingQueue.getQueue().get(0) had boolean2 removed"); assertSame(true, result, "result"); assertEquals(0, blockingQueue.consumerCount(), "blockingQueue.consumerCount()"); }