/** * Remove and return the first object in the queue. * * @return Dequeued object. * * @exception EmptyCollectionException The queue is empty. */ public E remove() throws EmptyCollectionException { if (isEmpty()) throw new EmptyCollectionException(); return removeFirst(); }