LongValueConverter extends AbstractValueConverter<Long> { @Override public Long convertValue(@Nonnull Value value, @Nonnull Thing thing, @Nonnull Class<? extends Long> desiredType) throws ValueConversionException { try { return ((Literal) value).longValue(); } catch (Exception e) { throw new ValueConversionException("Issue converting value '" + value + "' into a long", e); } } LongValueConverter(); @Override Long convertValue(@Nonnull Value value, @Nonnull Thing thing, @Nonnull Class<? extends Long> desiredType); @Override Value convertType(@Nonnull Long type, @Nonnull Thing thing);  }
@Test(expected = ValueConversionException.class) public void badTest() { valueConverter.convertValue(valueFactory.createLiteral("3.141592"), null, Long.class); }