public static BinaryOperator < MonetaryAmount > sum ( ExchangeRateProvider provider , CurrencyUnit currency ) { CurrencyConversion currencyConversion = provider . getCurrencyConversion ( currency ) ; return ( m1 , m2 ) -> currencyConversion . apply ( m1 ) . add ( currencyConversion . apply ( m2 ) ) ; }
return the sum and convert all values to specific currency using the provider if necessary