@Test
public void parse() throws Exception {

    assertEquals(Coin.COIN, NO_CODE.parse("1"));
    assertEquals(Coin.COIN, NO_CODE.parse("1."));
    assertEquals(Coin.COIN, NO_CODE.parse("1.0"));
    assertEquals(Coin.COIN, NO_CODE.decimalMark(',').parse("1,0"));
    assertEquals(Coin.COIN, NO_CODE.parse("01.0000000000"));
    assertEquals(Coin.COIN, NO_CODE.positiveSign('+').parse("+1.0"));
    assertEquals(Coin.COIN.negate(), NO_CODE.parse("-1"));
    assertEquals(Coin.COIN.negate(), NO_CODE.parse("-1.0"));
    assertEquals(Coin.CENT, NO_CODE.parse(".01"));
    assertEquals(Coin.MILLICOIN, MonetaryFormat.MBTC.parse("1"));
    assertEquals(Coin.MILLICOIN, MonetaryFormat.MBTC.parse("1.0"));
    assertEquals(Coin.MILLICOIN, MonetaryFormat.MBTC.parse("01.0000000000"));
    assertEquals(Coin.MILLICOIN, MonetaryFormat.MBTC.positiveSign('+').parse("+1.0"));
    assertEquals(Coin.MILLICOIN.negate(), MonetaryFormat.MBTC.parse("-1"));
    assertEquals(Coin.MILLICOIN.negate(), MonetaryFormat.MBTC.parse("-1.0"));
    assertEquals(Coin.MICROCOIN, MonetaryFormat.UBTC.parse("1"));
    assertEquals(Coin.MICROCOIN, MonetaryFormat.UBTC.parse("1.0"));
    assertEquals(Coin.MICROCOIN, MonetaryFormat.UBTC.parse("01.0000000000"));
    assertEquals(Coin.MICROCOIN, MonetaryFormat.UBTC.positiveSign('+').parse("+1.0"));
    assertEquals(Coin.MICROCOIN.negate(), MonetaryFormat.UBTC.parse("-1"));
    assertEquals(Coin.MICROCOIN.negate(), MonetaryFormat.UBTC.parse("-1.0"));
    assertEquals(Coin.CENT, NO_CODE.withLocale(new Locale("hi", "IN")).parse(".०१")); // Devanagari
}