如果尝试将一个集合添加到阻塞队列中,超过了阻塞队列的剩余容量,会发生什么?从我目前阅读的文档中并不清楚。
LinkedBlockingQueue<Integer> foo = new LinkedBlockingQueue<Integer>(3);
foo.add(1);
foo.add(2);
LinkedBlockingQueue<Integer> tenElements = new LinkedBlockingQueue<Integer(10);
for(int i = 0; i < 10; i++)
tenElements.add(i);
foo.addAll(collectionWith10elements);