protected PriceData createPrice(final AbstractOrderModel source, final Double val) { if (source == null) { throw new IllegalArgumentException("source order must not be null"); } final CurrencyModel currency = source.getCurrency(); if (currency == null) { throw new IllegalArgumentException("source order currency must not be null"); } // Get double value, handle null as zero final double priceValue = val != null ? val.doubleValue() : 0d; return getPriceDataFactory() .create(PriceDataType.BUY, BigDecimal.valueOf(priceValue), currency); }