public void destroyingEntityInvalidatesEntityRefs() {
EntityRef main = entityManager.create();
main.addComponent(new StringComponent());
EntityRef reference = entityManager.create();
EntityRefComponent refComp = reference.addComponent(new EntityRefComponent());
refComp.entityRef = entityManager.getEntitiesWith(StringComponent.class).iterator().next();
assertTrue(main.exists());
entityManager.getEntitiesWith(StringComponent.class).iterator().next().destroy();