Convert { public static BigDecimal fromVon(String number, Unit unit) { return fromVon(new BigDecimal(number), unit); } private  Convert(); static BigDecimal fromVon(String number, Unit unit); static BigDecimal fromVon(BigDecimal number, Unit unit); static BigDecimal toVon(String number, Unit unit); static BigDecimal toVon(BigDecimal number, Unit unit);  }
@Test public void testFromWei() { assertThat(Convert.fromVon("21000000000000", Convert.Unit.VON), is(new BigDecimal("21000000000000"))); assertThat(Convert.fromVon("21000000000000", Convert.Unit.KVON), is(new BigDecimal("21000000000"))); assertThat(Convert.fromVon("21000000000000", Convert.Unit.MVON), is(new BigDecimal("21000000"))); assertThat(Convert.fromVon("21000000000000", Convert.Unit.GVON), is(new BigDecimal("21000"))); assertThat(Convert.fromVon("21000000000000", Convert.Unit.SZABO), is(new BigDecimal("21"))); assertThat(Convert.fromVon("21000000000000", Convert.Unit.FINNEY), is(new BigDecimal("0.021"))); assertThat(Convert.fromVon("21000000000000", Convert.Unit.LAT), is(new BigDecimal("0.000021"))); assertThat(Convert.fromVon("21000000000000", Convert.Unit.KLAT), is(new BigDecimal("0.000000021"))); assertThat(Convert.fromVon("21000000000000", Convert.Unit.MLAT), is(new BigDecimal("0.000000000021"))); assertThat(Convert.fromVon("21000000000000", Convert.Unit.GLAT), is(new BigDecimal("0.000000000000021"))); }