### Question:
Fiat implements Monetary, Comparable<Fiat>, Serializable { public static Fiat parseFiat(final String currencyCode, final String str) { try { long val = new BigDecimal(str).movePointRight(SMALLEST_UNIT_EXPONENT).longValueExact(); return Fiat.valueOf(currencyCode, val); } catch (ArithmeticException e) { throw new IllegalArgumentException(e); } } private  Fiat(final String currencyCode, final long value); static Fiat valueOf(final String currencyCode, final long value); @Override int smallestUnitExponent(); @Override long getValue(); String getCurrencyCode(); static Fiat parseFiat(final String currencyCode, final String str); static Fiat parseFiatInexact(final String currencyCode, final String str); Fiat add(final Fiat value); Fiat subtract(final Fiat value); Fiat multiply(final long factor); Fiat divide(final long divisor); Fiat[] divideAndRemainder(final long divisor); long divide(final Fiat divisor); boolean isPositive(); boolean isNegative(); boolean isZero(); boolean isGreaterThan(Fiat other); boolean isLessThan(Fiat other); @Override int signum(); Fiat negate(); long longValue(); String toFriendlyString(); String toPlainString(); @Override String toString(); @Override boolean equals(final Object o); @Override int hashCode(); @Override int compareTo(final Fiat other); static final int SMALLEST_UNIT_EXPONENT; final long value; final String currencyCode; }### Answer:
@Test public void testParseFiat() { assertEquals(1, Fiat.parseFiat("EUR", "0.0001").value); assertEquals(1, Fiat.parseFiat("EUR", "0.00010").value); }
@Test(expected = IllegalArgumentException.class) public void testParseFiatOverprecise() { Fiat.parseFiat("EUR", "0.00011"); }
@Test public void testParseFiat() { assertEquals(10000, Fiat.parseFiat("EUR", "0.0001").value); assertEquals(10000, Fiat.parseFiat("EUR", "0.00010").value); }
@Test(expected = IllegalArgumentException.class) public void testParseFiatOverprecise() { Fiat.parseFiat("EUR", "0.000000011"); }