}
private void controlBooleanValueChange(final JComboBox combobox,
final AttributeBooleanCombo widget) throws DevFailed {
final InputListenerImpl listenerTest = new InputListenerImpl();
widget.addInputListener(listenerTest);
assertTrue("Listener should not yet be called", listenerTest.getNotifyCount() == 0);
final boolean newValue = switchComboBoxState(widget);
Sleeper.SECONDS.sleep(1);
assertTrue("InputListener has not been wake up on booleanValueChange",
listenerTest.isLaterNotified("booleanValueChange", 5000L));
final Object booleanNotification = listenerTest.getNotification("booleanValueChange");
final boolean currentValueTest = (booleanNotification instanceof Boolean) ? ((Boolean) booleanNotification)
.booleanValue() : !newValue;
assertTrue("Value received in InputListener.booleanValueChange is not the good one",
currentValueTest == newValue);
Sleeper.SECONDS.sleep(2);
assertTrue("Listener should be called 2 times", listenerTest.getNotifyCount() == 3);
assertTrue("booleanValueChange method should be called",
listenerTest.getNotification("booleanValueChange").equals(newValue));
assertTrue("booleanValueChange method should be called",
listenerTest.getNotification("booleanValueChange").equals(newValue));
// check if the listener is correctly removed
widget.removeInputListener(listenerTest);
listenerTest.reset();
switchComboBoxState(widget);
assertFalse("InputListener has not been correctly removed",
listenerTest.isLaterNotified("booleanValueChange", 5000L));
}