Map<String, PromotableOrderItemPriceDetail> promotableDetailsMap = buildPromotableDetailsMap(promotableOrderItem);
Map<Long, OrderItemPriceDetail> unmatchedDetailsMap = new HashMap<Long, OrderItemPriceDetail>();
for (OrderItemPriceDetail orderItemPriceDetail : orderItem.getOrderItemPriceDetails()) {
String detailKey = buildItemPriceDetailKey(orderItemPriceDetail);
PromotableOrderItemPriceDetail promotableDetail = promotableDetailsMap.remove(detailKey);
if (promotableDetail != null) {
processMatchingDetails(orderItemPriceDetail, promotableDetail);
} else {
unmatchedDetailsMap.put(orderItemPriceDetail.getId(), orderItemPriceDetail);
}