### Question:
MultiCurrencyAmountArray implements FxConvertible<CurrencyAmountArray>, ImmutableBean, Serializable { public static MultiCurrencyAmountArray total(Iterable<CurrencyAmountArray> arrays) { return Guavate.stream(arrays).collect(toMultiCurrencyAmountArray()); } @ImmutableConstructor private  MultiCurrencyAmountArray(int size, Map<Currency, DoubleArray> values); static MultiCurrencyAmountArray of(MultiCurrencyAmount... amounts); static MultiCurrencyAmountArray of(List<MultiCurrencyAmount> amounts); static MultiCurrencyAmountArray of(int size, IntFunction<MultiCurrencyAmount> valueFunction); static MultiCurrencyAmountArray of(Map<Currency, DoubleArray> values); Set<Currency> getCurrencies(); DoubleArray getValues(Currency currency); int size(); MultiCurrencyAmount get(int index); Stream<MultiCurrencyAmount> stream(); @Override CurrencyAmountArray convertedTo(Currency resultCurrency, FxRateProvider fxRateProvider); MultiCurrencyAmountArray plus(MultiCurrencyAmountArray other); MultiCurrencyAmountArray plus(MultiCurrencyAmount amount); MultiCurrencyAmountArray minus(MultiCurrencyAmountArray other); MultiCurrencyAmountArray minus(MultiCurrencyAmount amount); static MultiCurrencyAmountArray total(Iterable<CurrencyAmountArray> arrays); static Collector<CurrencyAmountArray, ?, MultiCurrencyAmountArray> toMultiCurrencyAmountArray(); static MultiCurrencyAmountArray.Meta meta(); @Override MultiCurrencyAmountArray.Meta metaBean(); int getSize(); ImmutableSortedMap<Currency, DoubleArray> getValues(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void total() { List<CurrencyAmountArray> arrays = ImmutableList.of( CurrencyAmountArray.of(USD, DoubleArray.of(10, 20, 30)), CurrencyAmountArray.of(USD, DoubleArray.of(5, 6, 7)), CurrencyAmountArray.of(EUR, DoubleArray.of(2, 4, 6)), CurrencyAmountArray.of(GBP, DoubleArray.of(11, 12, 13)), CurrencyAmountArray.of(GBP, DoubleArray.of(1, 2, 3))); Map<Currency, DoubleArray> expectedMap = ImmutableMap.of( USD, DoubleArray.of(15, 26, 37), EUR, DoubleArray.of(2, 4, 6), GBP, DoubleArray.of(12, 14, 16)); MultiCurrencyAmountArray expected = MultiCurrencyAmountArray.of(expectedMap); assertThat(MultiCurrencyAmountArray.total(arrays)).isEqualTo(expected); }