private static CompletableFuture<NodeRenderer> getFirstApplicableRenderer(List<CompletableFuture<Boolean>> futures,
                                                                            int index,
                                                                            List<NodeRenderer> renderers) {
    if (index >= futures.size()) {
      return CompletableFuture.completedFuture(null);
    }
    return futures.get(index).thenCompose(res -> {
      if (res) {
        return CompletableFuture.completedFuture(renderers.get(index));
      }
      else {
        return getFirstApplicableRenderer(futures, index + 1, renderers);
      }
    });
  }
private static CompletableFuture<NodeRenderer> getFirstApplicableRenderer(List<CompletableFuture<Boolean>> futures,
                                                                            int index,
                                                                            List<NodeRenderer> renderers)