### Question:
FxMatrix implements FxRateProvider, ImmutableBean, Serializable { public static FxMatrixBuilder builder() { return new FxMatrixBuilder(); } FxMatrix(
      Map<Currency, Integer> currencies,
      DoubleMatrix rates); static FxMatrix empty(); static FxMatrix of(CurrencyPair currencyPair, double rate); static FxMatrix of(Currency ccy1, Currency ccy2, double rate); static FxMatrixBuilder builder(); static Collector<? super Map.Entry<CurrencyPair, Double>, FxMatrixBuilder, FxMatrix> entriesToFxMatrix(); static Collector<? super Pair<CurrencyPair, Double>, FxMatrixBuilder, FxMatrix> pairsToFxMatrix(); ImmutableSet<Currency> getCurrencies(); @Override double fxRate(Currency baseCurrency, Currency counterCurrency); CurrencyAmount convert(CurrencyAmount amount, Currency targetCurrency); CurrencyAmount convert(MultiCurrencyAmount amount, Currency targetCurrency); FxMatrix merge(FxMatrix other); FxMatrixBuilder toBuilder(); @Override String toString(); static FxMatrix.Meta meta(); @Override FxMatrix.Meta metaBean(); DoubleMatrix getRates(); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void cannotAddEntryWithNoCommonCurrencyAndBuild() { assertThatIllegalStateException() .isThrownBy( () -> FxMatrix.builder() .addRate(GBP, USD, 1.6) .addRate(CHF, AUD, 1.6) .build()); }
@Test public void canAddEntryWithNoCommonCurrencyIfSuppliedBySubsequentEntries() { FxMatrix.builder() .addRate(GBP, USD, 1.6) .addRate(CHF, AUD, 1.6) .addRate(EUR, CHF, 1.2) .addRate(EUR, USD, 1.4) .build(); }