### Question:
MultiCurrencyScenarioArray implements ScenarioArray<MultiCurrencyAmount>, ScenarioFxConvertible<CurrencyScenarioArray>, ImmutableBean, Serializable { public static MultiCurrencyScenarioArray total(Iterable<CurrencyScenarioArray> arrays) { return Guavate.stream(arrays).collect(toMultiCurrencyScenarioArray()); } private  MultiCurrencyScenarioArray(
      MultiCurrencyAmountArray amounts); static MultiCurrencyScenarioArray of(MultiCurrencyAmountArray amounts); static MultiCurrencyScenarioArray of(MultiCurrencyAmount... amounts); static MultiCurrencyScenarioArray of(List<MultiCurrencyAmount> amounts); static MultiCurrencyScenarioArray of(int size, IntFunction<MultiCurrencyAmount> amountFunction); static MultiCurrencyScenarioArray of(Map<Currency, DoubleArray> values); Set<Currency> getCurrencies(); DoubleArray getValues(Currency currency); @Override int getScenarioCount(); @Override MultiCurrencyAmount get(int index); @Override Stream<MultiCurrencyAmount> stream(); @Override CurrencyScenarioArray convertedTo(Currency reportingCurrency, ScenarioFxRateProvider fxRateProvider); static MultiCurrencyScenarioArray total(Iterable<CurrencyScenarioArray> arrays); static Collector<CurrencyScenarioArray, ?, MultiCurrencyScenarioArray> toMultiCurrencyScenarioArray(); static MultiCurrencyScenarioArray.Meta meta(); @Override MultiCurrencyScenarioArray.Meta metaBean(); MultiCurrencyAmountArray getAmounts(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void total() { List<CurrencyScenarioArray> arrays = ImmutableList.of( CurrencyScenarioArray.of(USD, DoubleArray.of(10, 20, 30)), CurrencyScenarioArray.of(USD, DoubleArray.of(5, 6, 7)), CurrencyScenarioArray.of(EUR, DoubleArray.of(2, 4, 6)), CurrencyScenarioArray.of(GBP, DoubleArray.of(11, 12, 13)), CurrencyScenarioArray.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)); MultiCurrencyScenarioArray expected = MultiCurrencyScenarioArray.of(expectedMap); assertThat(MultiCurrencyScenarioArray.total(arrays)).isEqualTo(expected); }