Computation implements ReactiveValueChangeListener { public void stop() { stopped = true; invalidate(); invalidateListeners.clear(); clearDependencies(); } Computation(); void addDependency(ReactiveValue dependency); @Override void onValueChange(ReactiveValueChangeEvent changeEvent); void stop(); boolean isInvalidated(); void recompute(); void onNextInvalidate(InvalidateListener listener);  }
@Test public void testStopComputationBeforeInitialFlush() { CountingComputation computation = new CountingComputation(router); computation.stop(); Reactive.flush(); Assert.assertEquals(0, computation.getCount()); }