### Question:
Price extends MonetaryWrapper implements Comparable<Price> { public static Price parse(String currencyCode, String input) { String cleaned = ParsingUtils.convertCharsForNumber(input); if (CurrencyUtil.isFiatCurrency(currencyCode)) return new Price(Fiat.parseFiat(currencyCode, cleaned)); else return new Price(Altcoin.parseAltcoin(currencyCode, cleaned)); } Price(Monetary monetary); static Price parse(String currencyCode, String input); static Price valueOf(String currencyCode, long value); Volume getVolumeByAmount(Coin amount); Coin getAmountByVolume(Volume volume); String getCurrencyCode(); long getValue(); @Override int compareTo(@NotNull Price other); boolean isPositive(); Price subtract(Price other); String toFriendlyString(); String toPlainString(); @Override String toString();  }### Answer:
@Test public void testParse() { Price result = Price.parse("USD", "0.1"); Assert.assertEquals( "Fiat value should be formatted with two decimals.", "0.10 BTC/USD", result.toFriendlyString() ); result = Price.parse("EUR", "0.1234"); Assert.assertEquals( "Fiat value should be given two decimals", "0.1234 BTC/EUR", result.toFriendlyString() ); try { Price.parse("EUR", "0.12345"); Assert.fail("Expected IllegalArgumentException to be thrown when too many decimals are used."); } catch (IllegalArgumentException iae) { Assert.assertEquals( "Unexpected exception message.", "java.lang.ArithmeticException: Rounding necessary", iae.getMessage() ); } Assert.assertEquals( "Negative value should be parsed correctly.", -100000000L, Price.parse("LTC", "-1").getValue() ); Assert.assertEquals( "Comma (',') as decimal separator should be converted to period ('.')", "0.0001 BTC/USD", Price.parse("USD", "0,0001").toFriendlyString() ); Assert.assertEquals( "Too many decimals should get rounded up properly.", "10000.2346 LTC/BTC", Price.parse("LTC", "10000,23456789").toFriendlyString() ); Assert.assertEquals( "Too many decimals should get rounded down properly.", "10000.2345 LTC/BTC", Price.parse("LTC", "10000,23454999").toFriendlyString() ); Assert.assertEquals( "Underlying long value should be correct.", 1000023456789L, Price.parse("LTC", "10000,23456789").getValue() ); try { Price.parse("XMR", "56789.123456789"); Assert.fail("Expected IllegalArgumentException to be thrown when too many decimals are used."); } catch (IllegalArgumentException iae) { Assert.assertEquals( "Unexpected exception message.", "java.lang.ArithmeticException: Rounding necessary", iae.getMessage() ); } }