code: private void insertIQChildren(QueryNode parentNode, ImmutableList<IQTree> childrenTrees) {
  
          ImmutableList<QueryNode> newChildren = childrenTrees.stream()
                  .map(IQTree::getRootNode)
                  .map(n -> contains(n) ? n.clone() : n)
                  .collect(ImmutableCollectors.toList());
  
          if (parentNode instanceof BinaryOrderedOperatorNode) {
              addChild(parentNode, newChildren.get(0), Optional.of(LEFT), false);
              addChild(parentNode, newChildren.get(1), Optional.of(RIGHT), false);
          }
          else {
              newChildren
                      .forEach(c -> addChild(parentNode, c, Optional.empty(),false));
          }
  
          IntStream.range(0, childrenTrees.size())
                  .forEach(i -> insertIQChildren(newChildren.get(i), childrenTrees.get(i).getChildren()));
      }
docs: Recursive