BigDecimalToDoubleConverter implements Converter<Double, BigDecimal> { @Override public Double convertToPresentation(BigDecimal value, ValueContext context) { if (value == null) { return null; } return value.doubleValue(); }  @Override Result<BigDecimal> convertToModel(Double value, ValueContext context); @Override Double convertToPresentation(BigDecimal value, ValueContext context);  }
@Test public void testConvertToPresentation() { BigDecimalToDoubleConverter converter = new BigDecimalToDoubleConverter(); assertNull(converter.convertToPresentation(null, createContext())); Double d = converter.convertToPresentation(BigDecimal.valueOf(7.01), createContext()); assertEquals(7.01, d, 0.001); }