@Test
  public void testGetFormatted ()
  {
    IMutableCurrencyValue aCV = new CurrencyValue (ECurrency.EUR, MathHelper.toBigDecimal (5));
    if (EJavaVersion.JDK_9.isSupportedVersion ())
      assertEquals ("5,00" + CURRENCY_SPACE + "€", aCV.getCurrencyFormatted ());
    else
      assertEquals ("€" + CURRENCY_SPACE + "5,00", aCV.getCurrencyFormatted ());
    aCV = new CurrencyValue (ECurrency.EUR, new BigDecimal ("5.12"));
    if (EJavaVersion.JDK_9.isSupportedVersion ())
      assertEquals ("5,12" + CURRENCY_SPACE + "€", aCV.getCurrencyFormatted ());
    else
      assertEquals ("€" + CURRENCY_SPACE + "5,12", aCV.getCurrencyFormatted ());
    aCV = new CurrencyValue (ECurrency.USD, new BigDecimal ("5.12"));
    assertEquals ("$5.12", aCV.getCurrencyFormatted ());
    for (final ECurrency eCurrency : ECurrency.values ())
    {
      aCV = new CurrencyValue (eCurrency, new BigDecimal ("5.12"));
      final String sCurrencyFormatted = aCV.getCurrencyFormatted ();
      assertNotNull (sCurrencyFormatted);
      final String sValueFormatted = aCV.getValueFormatted ();
      assertNotNull (sValueFormatted);
      assertTrue (sValueFormatted, sValueFormatted.indexOf (CurrencyHelper.getCurrencySymbol (eCurrency)) < 0);
      CommonsTestHelper.testGetClone (aCV);
      // There seems to be a bug in the optimizer of 1.6.0_45 so that the output
      // values are sometimes reordered - dunno why :(
      LOGGER.info ("[" + sCurrencyFormatted + "][" + sValueFormatted + "]");
    }
  }
@Test
  public void testGetFormatted ()
  {
    IMutableCurrencyValue aCV = new CurrencyValue (ECurrency.EUR, MathHelper.toBigDecimal (5));
    if (EJavaVersion.JDK_9.isSupportedVersion ())
      assertEquals ("5,00" + CURRENCY_SPACE + "€", aCV.getCurrencyFormatted ());
    else
      assertEquals ("€" + CURRENCY_SPACE + "5,00", aCV.getCurrencyFormatted ());
    aCV = new CurrencyValue (ECurrency.EUR, new BigDecimal ("5.12"));
    if (EJavaVersion.JDK_9.isSupportedVersion ())
      assertEquals ("5,12" + CURRENCY_SPACE + "€", aCV.getCurrencyFormatted ());
    else
      assertEquals ("€" + CURRENCY_SPACE + "5,12", aCV.getCurrencyFormatted ());
    aCV = new CurrencyValue (ECurrency.USD, new BigDecimal ("5.12"));
    assertEquals ("$5.12", aCV.getCurrencyFormatted ());
    for (final ECurrency eCurrency : ECurrency.values ())
    {
      aCV = new CurrencyValue (eCurrency, new BigDecimal ("5.12"));
      final String sCurrencyFormatted = aCV.getCurrencyFormatted ();
      assertNotNull (sCurrencyFormatted);
      final String sValueFormatted = aCV.getValueFormatted ();
      assertNotNull (sValueFormatted);
      assertTrue (sValueFormatted, sValueFormatted.indexOf (CurrencyHelper.getCurrencySymbol (eCurrency)) < 0);
      CommonsTestHelper.testGetClone (aCV);
     
     
      LOGGER.info ("[" + sCurrencyFormatted + "][" + sValueFormatted + "]");
    }
  }
@test public void testgetformatted () { imutablecurrencyvalue acv = new currencyvalue (ecurrency.eur, mathhelper.tobigdecimal (5)); if (ejavaversion.jdk_9.issupportedversion ()) assertequals ("5,00" + currency_space + "€", acv.getcurrencyformatted ()); else assertequals ("€" + currency_space + "5,00", acv.getcurrencyformatted ()); acv = new currencyvalue (ecurrency.eur, new bigdecimal ("5.12")); if (ejavaversion.jdk_9.issupportedversion ()) assertequals ("5,12" + currency_space + "€", acv.getcurrencyformatted ()); else assertequals ("€" + currency_space + "5,12", acv.getcurrencyformatted ()); acv = new currencyvalue (ecurrency.usd, new bigdecimal ("5.12")); assertequals ("$5.12", acv.getcurrencyformatted ()); for (final ecurrency ecurrency : ecurrency.values ()) { acv = new currencyvalue (ecurrency, new bigdecimal ("5.12")); final string scurrencyformatted = acv.getcurrencyformatted (); assertnotnull (scurrencyformatted); final string svalueformatted = acv.getvalueformatted (); assertnotnull (svalueformatted); asserttrue (svalueformatted, svalueformatted.indexof (currencyhelper.getcurrencysymbol (ecurrency)) < 0); commonstesthelper.testgetclone (acv); logger.info ("[" + scurrencyformatted + "][" + svalueformatted + "]"); } }