LongToDoubleConverter implements Converter<Double, Long> { @Override public Double convertToPresentation(Long value, ValueContext context) { if (value == null) { return null; } return value.doubleValue(); }  @Override Result<Long> convertToModel(Double value, ValueContext context); @Override Double convertToPresentation(Long value, ValueContext context);  }
@Test public void testConvertToPresentation() { LongToDoubleConverter cv = new LongToDoubleConverter(); Double result = cv.convertToPresentation(null, createContext()); assertNull(result); result = cv.convertToPresentation(1234L, createContext()); assertEquals(1234.00, result.doubleValue(), 0.001); }