Java tutorial
//package com.java2s; import java.util.Collection; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; public class Main { public static <E> BlockingQueue<E> createLinkedBlockingQueue() { return new LinkedBlockingQueue<E>(); } public static <E> BlockingQueue<E> createLinkedBlockingQueue(int capacity) { return new LinkedBlockingQueue<E>(capacity); } public static <E> BlockingQueue<E> createLinkedBlockingQueue(Collection<? extends E> collection) { if (collection == null) { return new LinkedBlockingQueue<E>(); } return new LinkedBlockingQueue<E>(collection); } }