Well you are keying on the size of the map, this seems like it may cause your problems.
So if you have 3 things in the map you will have
1 => Obj1
2 => Obj2
3 => Obj3
if you remove one of these elements, say at 1, you will have
2 => Obj2
3 => Obj3
then later you go to insert, and set the key to "size() + 1", size will return 2, and you will try to insert at key 2 + 1 == 3. 3 is already taken. So it will either get overriden or fail (not sure how your find is working above).
Instead of inserting at the size + 1, I would check the last key and increment by 1 if thats how you want to manage the key.
Doug T.
2009-05-13 21:33:10