Choose a comparison mode for MoneyComparator
mainWhen instantiating a MoneyComparator, you must select a comparison mode to define how currency conversion affects the comparison logic:
PairwiseMode: Converts the first operand into the second operand's currency (without rounding) before comparing. This is highly precise for a single pair but can be non-transitive (e.g.,A < B,B < C, andC < Acould all be true) if exchange rates are asymmetric. Results ofmin()/max()may depend on the order of arguments.BaseCurrencyMode: Converts both operands to a common base currency before comparing. This ensures consistent, transitive ordering (ifA ≤ BandB ≤ C, thenA ≤ C), makingmin()/max()results independent of argument order. You must provide the base currency to the constructor.
If your ExchangeRateProvider supports dimensions (like time), you can pass them as the third argument to the MoneyComparator constructor.