202122232425262728
testQueue.put(testElement); int reportedSize = testQueue.size(); System.out.println(reportedSize); dzsm.shutdown(); } }
252627282930313233
String peekedElement = testQueue.peek(); System.out.println(peekedElement); long timeout = 5; String polledElement = testQueue.poll(timeout, TimeUnit.SECONDS); System.out.println(polledElement); dzsm.shutdown(); } }