public void changeOrAdd(MindmapLastStateStorage pStore) {
        boolean found = false;
        for (Iterator it = mLastStatesMap.getListMindmapLastStateStorageList()
                .iterator(); it.hasNext(); ) {
            MindmapLastStateStorage store = (MindmapLastStateStorage) it.next();
            if (Tools.safeEquals(pStore.getRestorableName(),
                    store.getRestorableName())) {
                // deep copy
                store.setLastZoom(pStore.getLastZoom());
                store.setLastSelected(pStore.getLastSelected());
                store.setX(pStore.getX());
                store.setY(pStore.getY());
                Vector listCopy = new Vector(pStore.getListNodeListMemberList());
                store.clearNodeListMemberList();
                for (Iterator it2 = listCopy.iterator(); it2.hasNext(); ) {
                    NodeListMember member = (NodeListMember) it2.next();
                    store.addNodeListMember(member);
                }
                found = true;
                setLastChanged(store);
                break;
            }
        }
        if (!found) {
            setLastChanged(pStore);
            mLastStatesMap.addMindmapLastStateStorage(pStore);
        }
        // size limit
        if (mLastStatesMap.sizeMindmapLastStateStorageList() > LIST_AMOUNT_LIMIT) {
            // make map from date to object:
            TreeMap dateToStoreMap = new TreeMap();
            for (Iterator it = mLastStatesMap
                    .getListMindmapLastStateStorageList().iterator(); it
                         .hasNext(); ) {
                MindmapLastStateStorage store = (MindmapLastStateStorage) it
                        .next();
                dateToStoreMap
                        .put(Long.valueOf(-store.getLastChanged()), store);
            }
            // clear list
            mLastStatesMap.clearMindmapLastStateStorageList();
            // rebuild
            int counter = 0;
            for (Iterator it = dateToStoreMap.entrySet().iterator(); it
                    .hasNext(); ) {
                Entry entry = (Entry) it.next();
                mLastStatesMap
                        .addMindmapLastStateStorage((MindmapLastStateStorage) entry
                                .getValue());
                counter++;
                if (counter >= LIST_AMOUNT_LIMIT) {
                    // drop the rest of the elements.
                    break;
                }
            }
        }
    }