I’d like to know in which case a ConcurrentLinkedQueue can’t remove an element from its Collections. The item exists, it is inside the collection but calling
SomeConcurrentLinkedQueue.remove(item)
won’t remove this item from the collection. Is the collection locked or something ?
If
ConcurrentLinkedQueue.remove(item)returnsfalse, this means thatitemdidn’t compare equal to any of the queue’s entries. If that’s not what you’re expecting, check theitem‘sequals()method for errors.Another possibility (pointed out by @Louis Wasserman) is that the queue contains multiple occurrences of
item.ConcurrentLinkedQueue.remove(item)would only remove one of them.