code: private static void addChildNodes(ProductPartitionNode parentNode,
        ListMultimap<Long, AdGroupCriterion> parentIdMap) {
      if (parentIdMap.containsKey(parentNode.getProductPartitionId())) {
        parentNode = parentNode.asSubdivision();
      }
      for (AdGroupCriterion adGroupCriterion : parentIdMap.get(parentNode.getProductPartitionId())) {
        ProductPartition partition = (ProductPartition) adGroupCriterion.getCriterion();
        ProductPartitionNode childNode = parentNode.addChild(partition.getCaseValue());
        childNode = childNode.setProductPartitionId(partition.getId());
        if (ProductPartitionType.SUBDIVISION.equals(partition.getPartitionType())) {
          childNode = childNode.asSubdivision();
        } else {
          if (adGroupCriterion instanceof BiddableAdGroupCriterion) {
            childNode = childNode.asBiddableUnit();
            BiddableAdGroupCriterion biddableAdGroupCriterion =
                (BiddableAdGroupCriterion) adGroupCriterion;
            Money cpcBidAmount = getBid(biddableAdGroupCriterion);
            if (cpcBidAmount != null) {
              childNode = childNode.setBid(cpcBidAmount.getMicroAmount());
            }
            childNode =
                childNode.setTrackingUrlTemplate(biddableAdGroupCriterion.getTrackingUrlTemplate());
            childNode = copyCustomParametersToNode(biddableAdGroupCriterion, childNode);
          } else {
            childNode = childNode.asExcludedUnit();
          }
        }
        addChildNodes(childNode, parentIdMap);
      }
    }
docs: Using the criteria in {@code parentIdMap}, recursively adds all children under the partition ID
  of {@code parentNode} to {@code parentNode}.
  
  @param parentNode required
  @param parentIdMap the multimap from parent partition ID to list of child criteria