public void entitiesModified(Iterable<SimpleEntity> entities) {
        for (SimpleEntity entity : entities) {
            if (entitiesInIndex.contains(entity)) {
                if (!entity.exists) {
                    entitiesInIndex.remove(entity);
                } else if (!hasAllComponents(entity)) {
                    entitiesInIndex.remove(entity);
                }
            } else {
                if (entity.exists && hasAllComponents(entity)) {
                    entitiesInIndex.add(entity);
                }
            }
        }
    }