CurrencyUtils { public static String nameForCurrency(String currency) { Currency cy = currencyFromCode(currency); return cy == null ? null : cy.getDisplayName(Locale.ENGLISH); }  static String countryFlagForCurrency(String c); static String nameForCurrency(String currency); static final String EUR; static final String USD; static final String GBP; static final String CHF; }
@Test public void testNameForCurrency() { assertThat(CurrencyUtils.nameForCurrency(USD)).isEqualTo("US Dollar"); assertThat(CurrencyUtils.nameForCurrency(EUR)).isEqualTo("Euro"); assertThat(CurrencyUtils.nameForCurrency(GBP)).isEqualTo("British Pound"); assertThat(CurrencyUtils.nameForCurrency("XAU")).isEqualTo("Gold"); assertThat(CurrencyUtils.nameForCurrency("XAF")).isEqualTo("Central African CFA Franc"); assertThat(CurrencyUtils.nameForCurrency("XAG")).isEqualTo("Silver"); assertThat(CurrencyUtils.nameForCurrency("TOTO")).isNull(); }