/** * Factory method to create a synchronized queue. * * @param <E> * the type of the elements in the queue * @param queue * the queue to decorate, must not be null * @return a new synchronized Queue * @throws NullPointerException * if queue is null */ public static <E> SynchronizedQueue<E> synchronizedQueue(final Queue<E> queue) { return new SynchronizedQueue<>(queue); }