void (@NotNull SuspendContextImpl suspendContext) { List<ThreadReferenceProxyImpl> pausedThreads = StreamEx.of(myDebugProcess.getSuspendManager().getPausedContexts()) .map(SuspendContextImpl::getThread) .nonNull() .toList(); // add paused threads first CompletableFuture.completedFuture(pausedThreads) .thenCompose(tds -> addThreads(tds, THREAD_NAME_COMPARATOR, false)) .thenCompose(res -> res ? getDebugProcess().getVirtualMachineProxy().allThreadsAsync() : CompletableFuture.completedFuture(Collections.emptyList())) .thenAccept(tds -> addThreads(tds, THREADS_SUSPEND_AND_NAME_COMPARATOR, true)) .exceptionally(throwable -> DebuggerUtilsAsync.logError(throwable)); }