SimpleCurrencyMatrix extends AbstractCurrencyMatrix { public void setLiveData(final Currency source, final Currency target, final ValueRequirement valueRequirement) { ArgumentChecker.notNull(source, "source"); ArgumentChecker.notNull(target, "target"); ArgumentChecker.notNull(valueRequirement, "valueRequirement"); if (source.equals(target)) { throw new IllegalArgumentException("target"); } addConversion(source, target, CurrencyMatrixValue.of(valueRequirement)); }  void setFixedConversion(final Currency source, final Currency target, final double rate); void setCrossConversion(final Currency source, final Currency target, final Currency cross); void setLiveData(final Currency source, final Currency target, final ValueRequirement valueRequirement);  }
@Test public void testLiveData () { final SimpleCurrencyMatrix matrix = new SimpleCurrencyMatrix (); matrix.setLiveData(currencyUSD, currencyGBP, new ValueRequirement(MarketDataRequirementNames.MARKET_VALUE, ComputationTargetType.PRIMITIVE, ExternalId.of("Test", "USD_GBP"))); CurrencyMatrixValue val = matrix.getConversion(currencyUSD, currencyGBP); assertTrue(val instanceof CurrencyMatrixValueRequirement); assertFalse(((CurrencyMatrixValueRequirement) val).isReciprocal()); val = matrix.getConversion(currencyGBP, currencyUSD); assertTrue(val instanceof CurrencyMatrixValueRequirement); assertTrue(((CurrencyMatrixValueRequirement) val).isReciprocal()); assertEquals(2, matrix.getSourceCurrencies().size()); assertEquals(2, matrix.getTargetCurrencies().size()); }