public static <E> Queue<E> newAtomicQueue(ConcurrentQueueSpec qs)
    {
        if (qs.isBounded())
        {
            // SPSC
            if (qs.isSpsc())
            {
                return new SpscAtomicArrayQueue<E>(qs.capacity);
            }
            // MPSC
            else if (qs.isMpsc())
            {
                return new MpscAtomicArrayQueue<E>(qs.capacity);
            }
            // SPMC
            else if (qs.isSpmc())
            {
                return new SpmcAtomicArrayQueue<E>(qs.capacity);
            }
            // MPMC
            else
            {
                return new MpmcAtomicArrayQueue<E>(qs.capacity);
            }
        }
        else
        {
            // SPSC
            if (qs.isSpsc())
            {
                return new SpscLinkedAtomicQueue<E>();
            }
            // MPSC
            else if (qs.isMpsc())
            {
                return new MpscLinkedAtomicQueue<E>();
            }
        }
        throw new IllegalArgumentException("Cannot match queue for spec:" + qs);
    }
The queue factory produces {@link Queue} instances based on a best fit to the {@link ConcurrentQueueSpec}.
This allows minimal dependencies between user code and the queue implementations and gives users a way to express
their requirements on a higher level.

@author nitsanw
@author akarnokd
jctools-core/src/test/java/org/jctools/util/AtomicQueueFactory.java