There is the PriorityBlockingQueue in the jdk, that is able to sort the elements with a (provided or default) Comparator.
Now I need a FilteringBlockingQueue, that is a concurrent Queue that offers at a given point in time only a subset of elements based on a dynamic filter and for which the poll operation doesn't remove the element but change it's state.
Changing the state of the element should also results in a signal so that any thread waiting (within a poll() call) would be able to get the item and continue.
The idea is to keep a single concurrent collection with different partitions, each of these partitions being a subset of element with the same state.
The polling should be done by passing the predicate and the mutator that will move the element to another partition in the same atomic operation.
Is such a thing already exists in a 'standard' library (and does it has a known name) ?
edit: I found a similar request here: Java Blocking List Implementation but without any accepted answer...