void (final AbstractProperty<Boolean> property, final TestFrameworkPropertyListener<Boolean> propertyListener, final TestFrameworkRunningModel model, final boolean sendValue) { final TestConsoleProperties properties = model.getProperties(); if (sendValue) { properties.addListenerAndSendValue(property, propertyListener); } else { properties.addListener(property, propertyListener); } Disposer.register(model, new Disposable() { @Override public void dispose() { properties.removeListener(property, propertyListener); } }); }