### Question:
Convert { public static BigDecimal toWei(String number, Unit unit) { return toWei(new BigDecimal(number), unit); } private  Convert(); static BigDecimal fromWei(String number, Unit unit); static BigDecimal fromWei(BigDecimal number, Unit unit); static BigDecimal toWei(String number, Unit unit); static BigDecimal toWei(BigDecimal number, Unit unit);  }### Answer:
@Test public void testToWei() { assertThat(Convert.toWei("21", Convert.Unit.WEI), is(new BigDecimal("21"))); assertThat(Convert.toWei("21", Convert.Unit.KWEI), is(new BigDecimal("21000"))); assertThat(Convert.toWei("21", Convert.Unit.MWEI), is(new BigDecimal("21000000"))); assertThat(Convert.toWei("21", Convert.Unit.GWEI), is(new BigDecimal("21000000000"))); assertThat(Convert.toWei("21", Convert.Unit.SZABO), is(new BigDecimal("21000000000000"))); assertThat(Convert.toWei("21", Convert.Unit.FINNEY), is(new BigDecimal("21000000000000000"))); assertThat(Convert.toWei("21", Convert.Unit.ETHER), is(new BigDecimal("21000000000000000000"))); assertThat(Convert.toWei("21", Convert.Unit.KETHER), is(new BigDecimal("21000000000000000000000"))); assertThat(Convert.toWei("21", Convert.Unit.METHER), is(new BigDecimal("21000000000000000000000000"))); assertThat(Convert.toWei("21", Convert.Unit.GETHER), is(new BigDecimal("21000000000000000000000000000"))); }
@Test public void testToWei() { assertEquals(Convert.toWei("21", Convert.Unit.WEI), (new BigDecimal("21"))); assertEquals(Convert.toWei("21", Convert.Unit.KWEI), (new BigDecimal("21000"))); assertEquals(Convert.toWei("21", Convert.Unit.MWEI), (new BigDecimal("21000000"))); assertEquals(Convert.toWei("21", Convert.Unit.GWEI), (new BigDecimal("21000000000"))); assertEquals(Convert.toWei("21", Convert.Unit.SZABO), (new BigDecimal("21000000000000"))); assertEquals( Convert.toWei("21", Convert.Unit.FINNEY), (new BigDecimal("21000000000000000"))); assertEquals( Convert.toWei("21", Convert.Unit.ETHER), (new BigDecimal("21000000000000000000"))); assertEquals( Convert.toWei("21", Convert.Unit.KETHER), (new BigDecimal("21000000000000000000000"))); assertEquals( Convert.toWei("21", Convert.Unit.METHER), (new BigDecimal("21000000000000000000000000"))); assertEquals( Convert.toWei("21", Convert.Unit.GETHER), (new BigDecimal("21000000000000000000000000000"))); }