public static <E> Queue<E> newQueue(ConcurrentQueueSpec qs)
    {
        if (qs.isBounded())
        {
            // SPSC
            if (qs.isSpsc())
            {
                return new SpscArrayQueue<E>(qs.capacity);
            }
            // MPSC
            else if (qs.isMpsc())
            {
                if (qs.ordering != Ordering.NONE)
                {
                    return new MpscArrayQueue<E>(qs.capacity);
                }
                else
                {
                    return new MpscCompoundQueue<E>(qs.capacity);
                }
            }
            // SPMC
            else if (qs.isSpmc())
            {
                return new SpmcArrayQueue<E>(qs.capacity);
            }
            // MPMC
            else
            {
                return new MpmcArrayQueue<E>(qs.capacity);
            }
        }
        else
        {
            // SPSC
            if (qs.isSpsc())
            {
                return new SpscLinkedQueue<E>();
            }
            // MPSC
            else if (qs.isMpsc())
            {
                return new MpscLinkedQueue();
            }
        }
        return new ConcurrentLinkedQueue<E>();
    }
The queue factory produces {@link java.util.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
jctools-core/src/test/java/org/jctools/util/QueueFactory.java