public static BinaryOperator < MonetaryAmount > min ( ExchangeRateProvider provider ) { return ( m1 , m2 ) -> { CurrencyConversion conversion = provider . getCurrencyConversion ( m1 . getCurrency ( ) ) ; if ( m1 . isGreaterThan ( conversion . apply ( m2 ) ) ) { return m2 ; } return m1 ; } ; }
return the minimum value if the monetary amounts have different currencies will converter first using the given ExchangeRateProvider