void (@NotNull JTree tree, @NotNull Consumer<? super AsyncPromise<Void>> consumer) { Promise<Void> expanding = ComponentUtil.getClientProperty(tree, EXPANDING); LOG.debug("EXPANDING: ", expanding); if (expanding == null) expanding = Promises.resolvedPromise(); expanding.onProcessed(value -> { AsyncPromise<Void> promise = new AsyncPromise<>(); ComponentUtil.putClientProperty(tree, EXPANDING, promise); consumer.accept(promise); }); }