DoubleValueConverter extends AbstractValueConverter<Double> { @Override public Double convertValue(Value value, Thing thing, Class<? extends Double> desiredType) throws ValueConversionException { try { return Double.parseDouble(value.stringValue()); } catch (NumberFormatException e) { throw new ValueConversionException("Issue getting double value from statement", e); } } DoubleValueConverter(); @Override Double convertValue(Value value, Thing thing, Class<? extends Double> desiredType); @Override Value convertType(Double type, Thing thing);  }
@Test public void testEmpty() { try { valueConverter.convertValue(valueFactory.createLiteral(""), null, type); TestCase.fail("Empty string should cause ValueConversionException"); } catch (ValueConversionException e) { TestCase.assertTrue("Cause of error should have been NumberFormatException", e.getCause() instanceof NumberFormatException); } }