### Question:
ProductPartitionNodeAdapter { static AdGroupCriterion createCriterionForSetBiddableUnit( ProductPartitionNode node, long adGroupId, BiddingStrategyConfiguration biddingConfig) { Preconditions.checkNotNull(node, "Null node"); Preconditions.checkNotNull(biddingConfig, "Null bidding configuration"); Preconditions.checkArgument(node.isBiddableUnit(), "Node is not a biddable unit"); BiddableAdGroupCriterion biddableCriterion = new BiddableAdGroupCriterion(); biddableCriterion.setAdGroupId(adGroupId); ProductPartition partition = new ProductPartition(); partition.setId(node.getProductPartitionId()); if (node.getParent() != null) { partition.setParentCriterionId(node.getParent().getProductPartitionId()); } partition.setCaseValue(node.getDimension()); partition.setPartitionType(ProductPartitionType.UNIT); biddableCriterion.setCriterion(partition); if (node.getBid() != null) { Money bidMoney = new Money(); bidMoney.setMicroAmount(node.getBid()); CpcBid cpcBid = new CpcBid(); cpcBid.setBid(bidMoney); biddingConfig.setBids(new Bids[] {cpcBid}); } else { biddingConfig.setBids(new Bids[0]); } biddableCriterion.setBiddingStrategyConfiguration(biddingConfig); if (node.getTrackingUrlTemplate() != null) { biddableCriterion.setTrackingUrlTemplate( node.getTrackingUrlTemplate()); } biddableCriterion.setUrlCustomParameters(createCustomParameters(node)); return biddableCriterion; } private  ProductPartitionNodeAdapter();   }### Answer:
@Test public void testCreateCriterionForSetBid_bidNotNull() { childNode.setBid(1500000L); testCommonAttributes( childNode, ProductPartitionNodeAdapter.createCriterionForSetBiddableUnit( childNode, adGroupId, biddingConfig), false); parentNode = parentNode.asBiddableUnit().setBid(2000000L); testCommonAttributes( parentNode, ProductPartitionNodeAdapter.createCriterionForSetBiddableUnit( parentNode, adGroupId, biddingConfig), false); }
@Test public void testCreateCriterionForSetBid_bidNull() { childNode.setBid(null); testCommonAttributes( childNode, ProductPartitionNodeAdapter.createCriterionForSetBiddableUnit( childNode, adGroupId, biddingConfig), false); parentNode.setBid(null); testCommonAttributes( parentNode, ProductPartitionNodeAdapter.createCriterionForSetBiddableUnit( parentNode, adGroupId, biddingConfig), false); }
@Test public void testCreateCriterionForSetBid_excludedNode_fails() { childNode = childNode.asExcludedUnit(); thrown.expect(IllegalArgumentException.class); ProductPartitionNodeAdapter.createCriterionForSetBiddableUnit( childNode, adGroupId, biddingConfig); }