### Question:
BehaviorMonitor { public void bind(final SubsystemContext<CareSubsystemModel> context) { context.logger().debug("binding to the behavior monitor"); context.models().addListener(new Listener<ModelEvent>() { public void onEvent(ModelEvent event) { if (event instanceof ModelChangedEvent) { dispatchEventToEvalutator((ModelChangedEvent) event, context); }else if(event instanceof ModelRemovedEvent) { dispatchEventToEvalutator((ModelRemovedEvent) event, context); } } }); if(context.model().isAlarmModeON()){ scheduleWindowEnable(context); } }  void bind(final SubsystemContext<CareSubsystemModel> context); void changeMode(String mode, SubsystemContext<CareSubsystemModel> context); static void initBehavior(String id, SubsystemContext<CareSubsystemModel> context); static void removeBehavior(String id, SubsystemContext<CareSubsystemModel> context); static void initBehavior(BehaviorEvaluator evaluator, SubsystemContext<CareSubsystemModel> context); static void clearBehaviorTimeouts(String behaviorId, SubsystemContext<CareSubsystemModel> context); void dispatchEventToEvalutator(ModelChangedEvent event, SubsystemContext<CareSubsystemModel> context); void dispatchEventToEvalutator(ModelRemovedEvent event, SubsystemContext<CareSubsystemModel> context); void handleTimeout(ScheduledEvent event, SubsystemContext<CareSubsystemModel> context); void careAlarmCleared(SubsystemContext<CareSubsystemModel> context); static BehaviorEvaluator loadBehaviorEvaluator(CareBehaviorTypeWrapper cb, SubsystemContext<CareSubsystemModel> context); final static SubsystemVariableKey BEHAVIOR_KEY; final static SubsystemVariableKey WINDOW_START_KEY; final static SubsystemVariableKey WINDOW_END_KEY; final static SubsystemVariableKey ALERT_KEY; }### Answer:
@Test public void testBind(){ monitor.bind(context); assertTimeoutExists(BehaviorMonitor.WINDOW_START_KEY.create(currentBehavior.getId()), currentWindowStart); }
@Test public void testBindInVisitMode(){ context.model().setAlarmMode(CareSubsystemCapability.ALARMMODE_VISIT); monitor.bind(context); assertNoTimeoutExists(BehaviorMonitor.WINDOW_START_KEY.create(currentBehavior.getId())); }