void () { myStubTree.removeAll(); if (myTreeModel != null) { Disposer.dispose(myTreeModelDisposable); myTreeModel = null; myTreeModelDisposable = Disposer.newDisposable(); } myNodeToStubs = new BidirectionalMap<>(); ViewerPsiBasedTree.removeListenerOfClass(myStubTree, StubTreeSelectionListener.class); }