code: func generateLRPInstanceGroupEvents(before, after *models.ActualLRP) []models.Event {
  	if before.Equal(after) {
  		// nothing changed
  		return nil
  	}
  
  	if after == nil {
  		return wrapEvent(models.NewActualLRPRemovedEvent(before.ToActualLRPGroup()))
  	}
  
  	if before == nil {
  		return wrapEvent(models.NewActualLRPCreatedEvent(after.ToActualLRPGroup()))
  	}
  
  	switch after.State {
  	case models.ActualLRPStateUnclaimed:
  		return generateUnclaimedGroupEvents(before, after)
  	case models.ActualLRPStateClaimed:
  		return generateUpdateGroupEvents(before, after)
  	case models.ActualLRPStateRunning:
  		return generateUpdateGroupEvents(before, after)
  	case models.ActualLRPStateCrashed:
  		return generateCrashedGroupEvents(before, after)
  	default:
  		return nil
  	}
  }
docs: // The main difference between this function and generateLRPInstanceEvents
  // (besides using different event types) is that the latter generates a
  // remove+create events when the LRP is unclaimed.  This function return a
  // ActualLRPChangedEvent instead to be compatible with old subscribers.