public void remove(Entity e)
    {
        if (e.getId() < groupByEntity.getCapacity())
        {
            String group = groupByEntity.get(e.getId());
            
            if (group != null)
            {
                groupByEntity.set(e.getId(), null);
                
                Bag<Entity> entities = entitiesByGroup.get(group);
                
                if (entities != null)
                {
                    entities.remove(e);
                }
            }
        }
    }