void (@NotNull final PropertyChangeListener listener, @NotNull Disposable parentDisposable) { addPropertyChangeListener(listener); Disposer.register(parentDisposable, new Disposable() { @Override public void dispose() { removePropertyChangeListener(listener); } }); }