public void clear() {
        int size = history.size();
        if (size > 0) {
            history.clear();
            shownHistory = history;
            fireIntervalRemoved(this, 0, size);
        }

        lastAdded = null;
    }
public void clear()