### Question:
IconAmount { public IconAmount convertUnit(Unit unit) { BigInteger loop = toLoop(); return IconAmount.of(new BigDecimal(loop).divide(getTenDigit(unit.getValue())), unit); } IconAmount(BigDecimal value, int digit); int getDigit(); @Override String toString(); BigInteger asInteger(); BigDecimal asDecimal(); BigInteger toLoop(); IconAmount convertUnit(Unit unit); IconAmount convertUnit(int digit); static IconAmount of(BigDecimal loop, int digit); static IconAmount of(BigDecimal loop, Unit unit); static IconAmount of(String loop, int digit); static IconAmount of(String loop, Unit unit); static IconAmount of(BigInteger loop, int digit); static IconAmount of(BigInteger loop, Unit unit);  }### Answer:
@Test void testConvertUnit() { BigDecimal loop = new BigDecimal("1000000000000000000"); IconAmount amount = IconAmount.of("1", IconAmount.Unit.ICX); assertEquals(new BigInteger("10"), amount.convertUnit(17).asInteger()); amount = IconAmount.of("1", IconAmount.Unit.ICX); assertEquals(new BigInteger("100"), amount.convertUnit(16).asInteger()); amount = IconAmount.of(new BigDecimal("1"), IconAmount.Unit.ICX); assertEquals(new BigDecimal("0.1"), amount.convertUnit(19).asDecimal()); amount = IconAmount.of(new BigDecimal("1"), IconAmount.Unit.ICX); assertEquals(new BigInteger("1000000000000000000"), amount.convertUnit(IconAmount.Unit.LOOP).asInteger()); }