CompletableFuture<List<NodeRenderer>> (List<? extends NodeRenderer> renderers, Type type) { DebuggerManagerThreadImpl.assertIsManagerThread(); CompletableFuture<Boolean>[] futures = renderers.stream().map(r -> r.isApplicableAsync(type)).toArray(CompletableFuture[]::new); return CompletableFuture.allOf(futures).thenApply(__ -> { List<NodeRenderer> res = new SmartList<>(); for (int i = 0; i < futures.length; i++) { try { if (futures[i].join()) { res.add(renderers.get(i)); } } catch (Exception e) { LOG.debug(e); } } return res; }); }