void (Function<? super Collection<? extends RenameHandler>, ? extends RenameHandler> selector, Disposable parentDisposable) { myRenameHandlerSelectorInTests = selector; Disposer.register(parentDisposable, new Disposable() { @Override public void dispose() { myRenameHandlerSelectorInTests = ContainerUtil::getFirstItem; } }); }