/** * Returns a transformed queue backed by the given queue. * <p> * Each object is passed through the transformer as it is added to the * Queue. It is important not to use the original queue after invoking this * method, as it is a backdoor for adding untransformed objects. * <p> * Existing entries in the specified queue will not be transformed. * If you want that behaviour, see {@link TransformedQueue#transformedQueue}. * * @param <E> the type of the elements in the queue * @param queue the queue to predicate, must not be null * @param transformer the transformer for the queue, must not be null * @return a transformed queue backed by the given queue * @throws NullPointerException if the queue or transformer is null */ public static <E> Queue<E> transformingQueue(final Queue<E> queue, final Transformer<? super E, ? extends E> transformer) { return TransformedQueue.transformingQueue(queue, transformer); }