CompletableFuture<List<DebuggerTreeNode>>[] (List<Field> fields, EvaluationContext evaluationContext, ValueDescriptorImpl parentDescriptor, NodeManager nodeManager, NodeDescriptorFactory nodeDescriptorFactory, ObjectReference objRef) { List<List<Field>> chunks = DebuggerUtilsImpl.partition(fields, XCompositeNode.MAX_CHILDREN_TO_SHOW); Set<String> names = Collections.synchronizedSet(new HashSet<>()); //noinspection unchecked return chunks.stream() .map(l -> createNodes(l, evaluationContext, parentDescriptor, nodeManager, nodeDescriptorFactory, objRef, names)) .toArray(CompletableFuture[]::new); }