ToDoubleConverter implements ConverterWrapper<Double, Object> { @Override public Double convertToAttribute(Object value) { assert value != null; assert supportsAxiomValueType(value.getClass()); return ((Number) value).doubleValue(); }  @Override Object convertToAxiomValue(Double value); @Override Double convertToAttribute(Object value); @Override boolean supportsAxiomValueType(Class<?> type);  }
@Test void toAttributeSupportsWideningIntegerConversion() { assertEquals(Double.valueOf(11), converter.convertToAttribute(Byte.valueOf((byte) 11))); assertEquals(Double.valueOf(117), converter.convertToAttribute(Short.valueOf((short) 117))); assertEquals(Double.valueOf(117), converter.convertToAttribute(117)); assertEquals(Double.valueOf(117L), converter.convertToAttribute(117L)); assertEquals(Double.valueOf(3.14), converter.convertToAttribute(3.14F), 0.001); }
@Test void toAttributeSupportsIdentityConversion() { assertEquals(Double.valueOf(Math.E), converter.convertToAttribute(Math.E)); }