class Context implements IContext<TEntity> {

    public void updateGroupsComponentAddedOrRemoved(TEntity entity, int index, IComponent component, List<Group<TEntity>>[] groupsForIndex) {
        List<Group<TEntity>> groups = groupsForIndex[index];
        if (groups != null) {
            List<Set<GroupChanged>> events = (List<Set<GroupChanged>>) _groupChangedListPool.get();

            for (int i = 0; i < groups.size(); i++) {
                events.add(groups.get(i).handleEntity(entity));
            }

            for (int i = 0; i < events.size(); i++) {
                Set<GroupChanged> groupChangedEvent = events.get(i);
                if (groupChangedEvent != null) {
                    for (GroupChanged listener : groupChangedEvent) {
                        listener.changed(groups.get(i), entity, index, component);
                    }

                }
            }
            _groupChangedListPool.push(events);
        }

    }

    public  Context(int totalComponents, int startCreationIndex, ContextInfo contexInfo,
                   EntityBaseFactory<TEntity> factoryMethod, Function<TEntity, IAERC> aercFactory);

}