For most collections the size() method requires constant time, but the time required to execute
ConcurrentLinkedQueue.size() is directly proportional to the number of elements in the queue. When the queue is large, this could
therefore be an expensive operation. Further, the results may be inaccurate if the queue is modified during execution.
By the way, if the size() is used only to check that the collection is empty, then the isEmpty() method should be used.
ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue();
//...
log.info("Queue contains " + queue.size() + " elements");