code: public static Collector<MonetaryAmount,?,Map<CurrencyUnit,List<MonetaryAmount>>> groupByCurrencyUnit(){
          return Collectors.groupingBy(MonetaryAmount::getCurrency);
      }
docs: Collector to group by CurrencyUnit
  @return the Collector to of Map<CurrencyUnit, List<MonetaryAmount>>