### Question:
FxRateScenarioArray implements ScenarioArray<FxRate>, ImmutableBean, Serializable { public DoubleArray convert(DoubleArray amounts, Currency fromCurrency, Currency toCurrency) { if (fromCurrency.equals(pair.getBase()) && toCurrency.equals(pair.getCounter())) { return amounts.multipliedBy(rates); } if (toCurrency.equals(pair.getBase()) && fromCurrency.equals(pair.getCounter())) { return rates.mapWithIndex((i, v) -> amounts.get(i) / v); } throw new IllegalArgumentException("Unknown rate: " + fromCurrency + "/" + toCurrency); } private  FxRateScenarioArray(
      CurrencyPair pair,
      DoubleArray rates); static FxRateScenarioArray of(CurrencyPair currencyPair, DoubleArray rates); static FxRateScenarioArray of(Currency base, Currency counter, DoubleArray rates); @Override int getScenarioCount(); @Override FxRate get(int scenarioIndex); @Override Stream<FxRate> stream(); double fxRate(Currency baseCurrency, Currency counterCurrency, int scenarioIndex); DoubleArray convert(DoubleArray amounts, Currency fromCurrency, Currency toCurrency); FxRateScenarioArray crossRates(FxRateScenarioArray other); static FxRateScenarioArray.Meta meta(); @Override FxRateScenarioArray.Meta metaBean(); CurrencyPair getPair(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void convert() { FxRateScenarioArray eurGbp = FxRateScenarioArray.of(Currency.EUR, Currency.GBP, DoubleArray.of(0.76, 0.75)); DoubleArray input = DoubleArray.of(1.11, 1.12); DoubleArray expected = DoubleArray.of(1.11 * 0.76, 1.12 * 0.75); DoubleArray converted = eurGbp.convert(input, Currency.EUR, Currency.GBP); for (int i = 0; i < converted.size(); i++) { assertThat(converted.get(i)).isEqualTo(expected.get(i), TOLERANCE); } }