### Question:
SwingUpdateManager { public synchronized void dispose() { timer.stop(); instances.remove(this); requestTime = NONE; bufferingStartTime = NONE; disposed = true; } SwingUpdateManager(Runnable r);  SwingUpdateManager(int minDelay, Runnable r);  SwingUpdateManager(int minDelay, int maxDelay, Runnable r);  SwingUpdateManager(int minDelay, int maxDelay, String name, Runnable r); synchronized void update(); synchronized void updateLater(); void updateNow(); synchronized void stop(); synchronized boolean hasPendingUpdates(); synchronized boolean isBusy(); synchronized void dispose(); synchronized boolean isDisposed(); @Override String toString(); String toStringDebug(); static final int DEFAULT_MAX_DELAY; }### Answer:
@Test public void testDispose() { for (int i = 0; i < 10; i++) { manager.update(); sleep(1); } assertTrue(manager.hasPendingUpdates()); manager.dispose(); assertFalse(manager.hasPendingUpdates()); int called = runnableCalled; manager.update(); waitForManager(); assertEquals(called, runnableCalled); }