assertEquals(Currency.USD, currencies.iterator().next());
}
@Test
public void testSwapNode() {
SwapNode node = new SwapNode(Tenor.ONE_DAY, Tenor.TEN_YEARS, FIXED_LEG_ID, SWAP_3M_IBOR_ID, SCHEME);
Set<Currency> currencies = node.accept(VISITOR);
assertEquals(1, currencies.size());
assertEquals(Currency.USD, currencies.iterator().next());
node = new SwapNode(Tenor.ONE_DAY, Tenor.TEN_YEARS, FIXED_LEG_ID, OIS_ID, SCHEME);
currencies = node.accept(VISITOR);
assertEquals(1, currencies.size());
assertEquals(Currency.USD, currencies.iterator().next());
node = new SwapNode(Tenor.ONE_DAY, Tenor.TEN_YEARS, FIXED_LEG_ID, CMS_SWAP_ID, SCHEME);
currencies = node.accept(VISITOR);
assertEquals(1, currencies.size());
assertEquals(Currency.USD, currencies.iterator().next());
node = new SwapNode(Tenor.ONE_DAY, Tenor.TEN_YEARS, FIXED_LEG_ID, COMPOUNDING_IBOR_ID, SCHEME);
currencies = node.accept(VISITOR);
assertEquals(1, currencies.size());
assertEquals(Currency.USD, currencies.iterator().next());
node = new SwapNode(Tenor.ONE_DAY, Tenor.TEN_YEARS, SWAP_3M_IBOR_ID, SWAP_6M_EURIBOR_ID, SCHEME);
currencies = node.accept(VISITOR);
assertEquals(2, currencies.size());
assertEquals(Sets.newHashSet(Currency.EUR, Currency.USD), currencies);
}