static void outputProductPartitionTree(
      BulkAdGroupProductPartition node,
      Map<Long, ArrayList<BulkAdGroupProductPartition>> childBranches,
      int treeLevel) {
    AdGroupCriterion adGroupCriterion = node.getAdGroupCriterion();

    ProductPartition criterion = (ProductPartition) adGroupCriterion.getCriterion();

    System.out.printf(
        "%" + ((treeLevel > 0) ? treeLevel * 4 : "") + "s%s\n", "", criterion.getPartitionType());

    System.out.printf(
        "%" + ((treeLevel > 0) ? treeLevel * 4 : "") + "s%s%d\n",
        "",
        "ParentCriterionId: ",
        criterion.getParentCriterionId());

    System.out.printf(
        "%" + ((treeLevel > 0) ? treeLevel * 4 : "") + "s%s%d\n",
        "",
        "Id: ",
        adGroupCriterion.getId());

    if (criterion.getPartitionType() == ProductPartitionType.UNIT) {
      if (adGroupCriterion instanceof BiddableAdGroupCriterion) {
        System.out.printf(
            "%" + ((treeLevel > 0) ? treeLevel * 4 : "") + "s%s%.2f\n",
            "",
            "Bid amount: ",
            ((FixedBid) ((BiddableAdGroupCriterion) adGroupCriterion).getCriterionBid())
                .getBid()
                .getAmount());

      } else {
        if (adGroupCriterion instanceof NegativeAdGroupCriterion) {
          System.out.printf("%" + treeLevel * 4 + "s%s\n", "", "Not bidding on this condition");
        }
      }
    }

    String nullAttribute =
        (criterion.getParentCriterionId() != null) ? "(All Others)" : "(Tree Root)";

    System.out.printf(
        "%" + ((treeLevel > 0) ? treeLevel * 4 : "") + "s%s%s\n",
        "",
        "Attribute: ",
        (criterion.getCondition().getAttribute() == null)
            ? nullAttribute
            : criterion.getCondition().getAttribute());

    System.out.printf(
        "%" + ((treeLevel > 0) ? treeLevel * 4 : "") + "s%s%s\n",
        "",
        "Condition: ",
        criterion.getCondition().getOperand());

    for (BulkAdGroupProductPartition childNode : childBranches.get(adGroupCriterion.getId())) {
      outputProductPartitionTree(childNode, childBranches, treeLevel + 1);
    }
  }