class BehaviorManager {

   public String addBehavior(CareBehaviorTypeWrapper behavior, SubsystemContext<CareSubsystemModel> context) {
      if (behaviorNameExists(behavior.getName(), context)) {
         throw new ErrorEventException(CareErrors.duplicateName(behavior.getName()));
      }
      validateTimeWindows(context, behavior);
      validateBehaviorType(behavior, context);
      behavior.setId(UUID.randomUUID().toString());
      context.setVariable(BehaviorMonitor.BEHAVIOR_KEY.create(behavior.getId()), behavior.toMap());
      BehaviorUtil.addStringToSet(behavior.getId(), CareSubsystemCapability.ATTR_BEHAVIORS, context.model());
      BehaviorMonitor.initBehavior(behavior.getId(), context);
      broadcastBehaviorEvent(behavior, context, CareSubsystemCapability.BehaviorActionEvent.BEHAVIORACTION_ADDED);
      return behavior.getId();
   }

   public  BehaviorManager();

}