void () { Disposable parent = Disposer.newDisposable("parent"); Disposable child = Disposer.newDisposable("child"); Disposer.register(parent, child); Disposable grand = Disposer.newDisposable("grand"); Disposer.register(child, grand); try { Disposer.disposeChildren(parent, __->true); assertFalse(Disposer.isDisposed(parent)); Disposer.dispose(parent); assertTrue(Disposer.isDisposed(parent)); } finally { Disposer.dispose(grand); Disposer.dispose(child); Disposer.dispose(parent); } }