Especially also checking the impact of the owning set field!
Especially:
- remove(annotationinstance):
- the instance must be directly included in the set, based on the hash function used which is the default (so based on object id)
- since only directly included annotations can be removed, anything where the owning set does not match is automatically rule out. However checking if owning sets match first may give better hints in the case of an error (better then key error).
- CHANGE: always try to remove from set first, then remove id from map, that way we cannot be left with an inconsistent state!