### Question:
CreatePasswordSensor extends AddSensor<String> { @Override public void apply(EntityLocal entity) { super.apply(entity); String password = acceptableChars == null ? Identifiers.makeRandomPassword(passwordLength) : Identifiers.makeRandomPassword(passwordLength, acceptableChars); entity.sensors().set(sensor, password); } CreatePasswordSensor(Map<String, String> params);  CreatePasswordSensor(ConfigBag params); @Override void apply(EntityLocal entity); static final ConfigKey<Integer> PASSWORD_LENGTH; static final ConfigKey<String> ACCEPTABLE_CHARS; }### Answer:
@Test public void testCreatePasswordCreatesAPasswordOfDefaultLength() { final CreatePasswordSensor sensor = new CreatePasswordSensor(ConfigBag.newInstance() .configure(CreatePasswordSensor.SENSOR_NAME, SENSOR_STRING.getName())); sensor.apply(entity); String password = entity.getAttribute(SENSOR_STRING); Asserts.assertEquals(password.length(), 12); }