### Question:
MoneyUtils { public static BigDecimal getBigDecimal(long num) { return BigDecimal.valueOf(num); } private  MoneyUtils(); static BigDecimal getBigDecimal(long num); static BigDecimal getBigDecimal(double num); static BigDecimal getBigDecimal(Number num); static BigDecimal getBigDecimal(Number num, MonetaryContext moneyContext); static MathContext getMathContext(MonetaryContext monetaryContext, RoundingMode defaultMode); static void checkAmountParameter(MonetaryAmount amount, CurrencyUnit currencyUnit); static void checkNumberParameter(Number number); static String replaceNbspWithSpace(String s); static final String NBSP_STRING; static final String NNBSP_STRING; static final char NBSP; static final char NNBSP; }### Answer:
@Test public void testGetBigDecimal_long() { assertEquals(getBigDecimal(10), TEN); }
@Test public void testGetBigDecimal_double() { expectThrows(ArithmeticException.class, () -> getBigDecimal(Double.NaN)); expectThrows(ArithmeticException.class, () -> getBigDecimal(Double.POSITIVE_INFINITY)); expectThrows(ArithmeticException.class, () -> getBigDecimal(Double.NEGATIVE_INFINITY)); assertEquals(getBigDecimal(0.24D), new BigDecimal("0.24")); assertEquals(getBigDecimal(0.25F), new BigDecimal("0.25")); }
@Test public void testGetBigDecimal_Number() { expectThrows(ArithmeticException.class, () -> getBigDecimal(Float.valueOf(Float.NaN))); expectThrows(ArithmeticException.class, () -> getBigDecimal(Float.valueOf(Float.POSITIVE_INFINITY))); expectThrows(ArithmeticException.class, () -> getBigDecimal(Float.valueOf(Float.NEGATIVE_INFINITY))); assertEquals(getBigDecimal(Byte.valueOf((byte) 10)), TEN); assertEquals(getBigDecimal(Short.valueOf((short) 10)), TEN); assertEquals(getBigDecimal(Float.valueOf(0.24F)), new BigDecimal("0.24")); }