Code example for ConcurrentLinkedQueue

0
 
    public static <T> Queue<T> newQueue() {
        if (useLinkedTransferQueue) {
            return new LinkedTransferQueue<>();
        } 
        return new ConcurrentLinkedQueue<>();
    } 
 
    public static <T> Deque<T> newDeque() {
        return new ConcurrentLinkedDeque<>();
    } 
 
    public static <T> BlockingQueue<T> newBlockingQueue() {
        return new LinkedTransferQueue<>();
    } 
 
    private ConcurrentCollections() { 
 
    } 
}