### Question:
BigDecimalDataConverter implements DataConverter<BigDecimal> { @Override public BigDecimal stringToValue(String rawData) throws ParseException{ if(StringUtils.isNotEmpty(rawData)) { BigDecimal value = new BigDecimal(rawData.replace(",", ".")).stripTrailingZeros(); if (value.scale() < 0) return value.setScale(0); return value; } return null; }  String valueToString(BigDecimal value); @Override BigDecimal stringToValue(String rawData);  }### Answer:
@Test public void valueToString_rawData() throws ParseException { BigDecimalDataConverter bigD = new BigDecimalDataConverter(); assertNull(bigD.stringToValue(null)); assertNull(bigD.stringToValue("")); assertEquals(new BigDecimal("100"), bigD.stringToValue("100")); assertEquals(new BigDecimal("100"), bigD.stringToValue("100.00")); assertEquals(new BigDecimal("-100"), bigD.stringToValue("-100.00")); assertEquals(new BigDecimal("0"), bigD.stringToValue("00.00")); assertEquals(new BigDecimal("1001.001").stripTrailingZeros(), bigD.stringToValue("1001.001")); }