@Test public void expectNoDisposeOnAdd() { AssertDisposable dsp1 = new AssertDisposable(); final Disposer toTest = new Disposer(); toTest.add(dsp1); dsp1.assertNotDisposed(); }
public void add(Disposable disposable) { checkNotDisposed(); if (null == disposable) { throw new IllegalArgumentException("Cannot add a null-reference as disposable"); } synchronized (this) { disposables.add(disposable); } }
Disposer implements Disposable { public void add(Disposable disposable) { checkNotDisposed(); if (null == disposable) { throw new IllegalArgumentException("Cannot add a null-reference as disposable"); } synchronized (this) { disposables.add(disposable); } } }
Disposer implements Disposable { public void add(Disposable disposable) { checkNotDisposed(); if (null == disposable) { throw new IllegalArgumentException("Cannot add a null-reference as disposable"); } synchronized (this) { disposables.add(disposable); } }  }
Disposer implements Disposable { public void add(Disposable disposable) { checkNotDisposed(); if (null == disposable) { throw new IllegalArgumentException("Cannot add a null-reference as disposable"); } synchronized (this) { disposables.add(disposable); } }  void add(Disposable disposable); void checkNotDisposed(); @Override void dispose(); void dispose(Disposable disposeAndRemove); void tryAdd(Object obj); void tryDispose(Object obj); }
Disposer implements Disposable { public void add(Disposable disposable) { checkNotDisposed(); if (null == disposable) { throw new IllegalArgumentException("Cannot add a null-reference as disposable"); } synchronized (this) { disposables.add(disposable); } }  void add(Disposable disposable); void checkNotDisposed(); @Override void dispose(); void dispose(Disposable disposeAndRemove); void tryAdd(Object obj); void tryDispose(Object obj);  }