public TypeValue dequeue() throws EmptyQueueException {
        if (head.getNext() == null) {
            throw new EmptyQueueException("Queue is empty!!!");
        } else {
            QueueElement tmp = head.getNext();
            head = tmp;
            return tmp.getValue();
        }
    }