### Question:
FxRateScenarioArray implements ScenarioArray<FxRate>, ImmutableBean, Serializable { public FxRateScenarioArray crossRates(FxRateScenarioArray other) { return pair.cross(other.pair).map(cross -> computeCross(other, cross)) .orElseThrow(() -> new IllegalArgumentException(Messages.format( "Unable to cross when no unique common currency: {} and {}", pair, other.pair))); } 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 crossRates() { FxRateScenarioArray eurGbp = FxRateScenarioArray.of(Currency.EUR, Currency.GBP, DoubleArray.of(0.76, 0.75)); FxRateScenarioArray eurUsd = FxRateScenarioArray.of(Currency.EUR, Currency.USD, DoubleArray.of(1.11, 1.12)); FxRateScenarioArray gbpEur = FxRateScenarioArray.of(Currency.GBP, Currency.EUR, DoubleArray.of(1 / 0.76, 1 / 0.75)); FxRateScenarioArray usdEur = FxRateScenarioArray.of(Currency.USD, Currency.EUR, DoubleArray.of(1 / 1.11, 1 / 1.12)); FxRateScenarioArray expectedGbpUsd = FxRateScenarioArray.of(Currency.GBP, Currency.USD, DoubleArray.of(1.460526315789474, 1.4933333333333334)); assertArraysEqual(eurGbp.crossRates(eurUsd), expectedGbpUsd); assertArraysEqual(eurGbp.crossRates(usdEur), expectedGbpUsd); assertArraysEqual(gbpEur.crossRates(eurUsd), expectedGbpUsd); assertArraysEqual(gbpEur.crossRates(usdEur), expectedGbpUsd); assertArraysEqual(eurUsd.crossRates(eurGbp), expectedGbpUsd); assertArraysEqual(usdEur.crossRates(eurGbp), expectedGbpUsd); assertArraysEqual(eurUsd.crossRates(gbpEur), expectedGbpUsd); assertArraysEqual(usdEur.crossRates(gbpEur), expectedGbpUsd); }