code: private void insertChildren(QueryNode parentNode, ImmutableList<IQTree> childrenTrees,
                                  IntermediateQueryBuilder queryBuilder) {
          AtomicInteger i = new AtomicInteger(0);
          childrenTrees.stream()
                  .map(IQTree::getRootNode)
                  .map(n -> queryBuilder.contains(n) ? n.clone() : n)
                  .forEach(t -> insertChildTree(parentNode, t, childrenTrees.get(i.get()), queryBuilder, i.getAndIncrement()));
      }
docs: Recursive