Fixes DynamicGroupTest.testGroupAddsAndRemovesManagedAndUnmanagedEntitiesExactlyOnce

The diff around line 260 is the fix.