@Test public void shouldDisableAndReanableChangeNotificationWhenChangingThePropertyValue() { cut.execute(dummyObservable, new Runnable() { @Override public void run() { dummyObservable.setValue(NEW_VALUE); } }); final InOrder inOrder = inOrder(listeners, dummyObservable); inOrder.verify(listeners).disableFor(dummyObservable); inOrder.verify(dummyObservable).setValue(NEW_VALUE); inOrder.verify(listeners).enableFor(dummyObservable); }
public void execute(final Object observable, final Runnable change) { listeners.disableFor(observable); change.run(); listeners.enableFor(observable); }
SilentChangeExecutor { public void execute(final Object observable, final Runnable change) { listeners.disableFor(observable); change.run(); listeners.enableFor(observable); } }
SilentChangeExecutor { public void execute(final Object observable, final Runnable change) { listeners.disableFor(observable); change.run(); listeners.enableFor(observable); } SilentChangeExecutor(); }
SilentChangeExecutor { public void execute(final Object observable, final Runnable change) { listeners.disableFor(observable); change.run(); listeners.enableFor(observable); } SilentChangeExecutor(); void execute(final Object observable, final Runnable change); void registerListenersToSilence(final Listeners listeners); }
SilentChangeExecutor { public void execute(final Object observable, final Runnable change) { listeners.disableFor(observable); change.run(); listeners.enableFor(observable); } SilentChangeExecutor(); void execute(final Object observable, final Runnable change); void registerListenersToSilence(final Listeners listeners);  }