public void deleteElement(ValueType value) throws NotExistException {
        ListElement<ValueType> previous = head;
        ListElement<ValueType> current = head.getNext();
        if (exist(value)) {
            while (current != tail.getNext()) {
                if (current.getValue() == value) {
                    previous.setNext(current.getNext());
                    count--;
                    return;
                } else {
                    previous = current;
                    current = current.getNext();
                }
            }
        } else {
            throw new NotExistException("Element with current value doesn't exist!");
        }
    }