@Override
public Order addOrUpdateOrderItemAttributes(Order order, OrderItem item, Map<String,String> attributeValues, boolean priceOrder) throws ItemNotFoundException, PricingException {
if (!order.getOrderItems().contains(item)) {
throw new ItemNotFoundException("Order Item (" + item.getId() + ") not found in Order (" + order.getId() + ")");
}
OrderItem itemFromOrder = order.getOrderItems().get(order.getOrderItems().indexOf(item));
Map<String,OrderItemAttribute> orderItemAttributes = itemFromOrder.getOrderItemAttributes();
if (orderItemAttributes == null) {
orderItemAttributes = new HashMap<String,OrderItemAttribute>();
itemFromOrder.setOrderItemAttributes(orderItemAttributes);
}
boolean changeMade = false;
for (String attributeName : attributeValues.keySet()) {
String attributeValue = attributeValues.get(attributeName);