### Question:
LockJamGenerator extends AlertGenerator { @Override public void onStarted(SubsystemContext<PlaceMonitorSubsystemModel> context, AlertScratchPad scratch) { context.models().getModels(DOOR_LOCK).forEach(door -> handleModelChanged(context, door, scratch)); } @Inject  LockJamGenerator(ProductCatalogManager prodCat); @Override void onStarted(SubsystemContext<PlaceMonitorSubsystemModel> context, AlertScratchPad scratch); static final String WARN_KEY; }### Answer:
@Test public void testOnStartedAddsAlert() { replay(); modelStore.updateModel(lock.getAddress(), ImmutableMap.of(DeviceAdvancedCapability.ATTR_ERRORS, ImmutableMap.of(LockJamGenerator.WARN_KEY, "jammed"))); generator.onStarted(context, scratchPad); String key = AlertKeys.key(SmartHomeAlert.ALERTTYPE_DEV_WARN_LOCK_JAM, lock.getAddress()); assertScratchPadHasAlert(key); SmartHomeAlert expected = createAlert(); assertAlert(expected, scratchPad.getAlert(key)); }