### Question:
ShortToFloat extends AbstractReformatToFloat<Short> { @Override protected float apply(double number, double scaleFactor, double addOffset) { return (float) (scaleFactor * number + addOffset); } ShortToFloat();   }### Answer:
@Override @Test public void testNumericConversion() throws RuleException { final Array sourceArray = Array.factory(DataType.SHORT, new int[]{2}); sourceArray.setShort(0, (short) 5); sourceArray.setShort(1, (short) 7); final Array targetArray = getRule().apply(sourceArray, getSourceColumn()); assertTrue(targetArray.getElementType() == float.class); assertEquals(10.5f, targetArray.getFloat(0), 0.0f); assertEquals(14.5f, targetArray.getFloat(1), 0.0f); }
@Test(expected = RuleException.class) public void testColumnConversion_ImproperType() throws Exception { getRule().apply(new ColumnBuilder().type(DataType.BYTE).build()); }