I'd like to work with the following data structure:
List<BlockingQueue<AtomicInteger>> listOfQueues =
Collections.synchronizedList(
new ArrayList<ArrayBlockingQueue<AtomicInteger>>(15)
);
So I'd like to construct a list of initially empty BlockingQueue
s in such a way that every single BlockingQueue
shall encapsulate AtomicInteger
s. I know that BlockingQueue
is an inteface that shall be implemented by for example ArrayBlockingQueue
.
It's also important to obtain a synchonizedList of 15
elements.
I printed out the size of the synchonizedList and it yielded 0
.
How to fix the aforementioned issues?