code: static NodeDifference diff(ProductPartitionNode originalNode,
        ProductPartitionNode newNode, Comparator<ProductDimension> dimensionComparator) {
      NodeDifference nodeDifference;
      if (originalNode == null && newNode == null) {
        nodeDifference = NodeDifference.NONE;
      } else if (originalNode == null) {
        nodeDifference = NodeDifference.NEW_NODE;
      } else if (newNode == null) {
        nodeDifference = NodeDifference.REMOVED_NODE;
      } else if (dimensionComparator.compare(originalNode.getDimension(), newNode.getDimension())
          != 0) {
        throw new IllegalArgumentException(
            "Original node and new node are not for the same product dimension");
      } else if (originalNode.isUnit() != newNode.isUnit()) {
        nodeDifference = NodeDifference.PARTITION_TYPE_CHANGE;
      } else if (originalNode.isExcludedUnit() != newNode.isExcludedUnit()) {
        nodeDifference = NodeDifference.EXCLUDED_UNIT_CHANGE;
      } else if (!originalNode.isExcludedUnit() && originalNode.isUnit() && newNode.isUnit()) {
        // Both nodes are non-excluded units - the only possible differences
        // left are from the bid, tracking URL template, or custom parameters.
        nodeDifference = NodeDifference.NONE;
        if (!Objects.equals(originalNode.getBid(), newNode.getBid())) {
          nodeDifference = NodeDifference.BIDDABLE_UNIT_CHANGE;
        }
        if (!Objects.equals(
            originalNode.getTrackingUrlTemplate(), newNode.getTrackingUrlTemplate())) {
          nodeDifference = NodeDifference.BIDDABLE_UNIT_CHANGE;
        }
        if (!Objects.equals(originalNode.getCustomParameters(), newNode.getCustomParameters())) {
          nodeDifference = NodeDifference.BIDDABLE_UNIT_CHANGE;
        }
      } else {
        nodeDifference = NodeDifference.NONE;
      }
      return nodeDifference;
    }
docs: Returns the {@link NodeDifference} between the original node and the new node.
  
  @throws IllegalArgumentException if both nodes are not null and do not have the same
  {@link ProductPartitionNode#getDimension()}.