CompletableFuture<List<DebuggerTreeNode>> (List<Field> fields, EvaluationContext evaluationContext, ValueDescriptorImpl parentDescriptor, NodeManager nodeManager, NodeDescriptorFactory nodeDescriptorFactory, ObjectReference objRef) { List<Field> fieldsToShow = ContainerUtil.filter(fields, field -> shouldDisplay(evaluationContext, objRef, field)); if (fieldsToShow.isEmpty()) { return CompletableFuture.completedFuture(Collections.emptyList()); } CompletableFuture<List<DebuggerTreeNode>>[] futures = createNodesChunked( fieldsToShow, evaluationContext, parentDescriptor, nodeManager, nodeDescriptorFactory, objRef ); return CompletableFuture.allOf(futures).thenApply(__ -> StreamEx.of(futures).flatCollection(CompletableFuture::join).toList()); }