CollectionPropertyTests: minor adjustment to better test caching by type (fixes #508075)

While trying to have the standard non-plugged tests run, I found that the new caching
using adapters did not handle well the case in which we added instances with their own
contents - these would get notified as one ADD event, not as multiple ADDitions.

I've reverted the old change that inverted removals in EmfModel, and instead I have the
handling of adapter events go through the contents of the added/removed elements recursively.

I also avoid changing the cache through adapter events if the allContents/type/kind caches
have not been initialized previously by an explicit request to one of the allContents()
/ getAllOfType() / getAllOfKind() methods. Otherwise, the cache would be left in an invalid
state.

These bugs are easy to trigger if we just change the order in which the EUnitRunner prepares
the "Ecore" model, so I'm reusing the test for that as well by having the InMemoryEmfModel
created *before* it's populated.
4 files changed