### Question:
FloatPercentToShort extends AbstractReformat<Float, Short> { @Override protected void apply(Array sourceArray, Array targetArray, Number scaleFactor, Number addOffset) { final IndexIterator sourceIterator = sourceArray.getIndexIterator(); final IndexIterator targetIterator = targetArray.getIndexIterator(); while(sourceIterator.hasNext() && targetIterator.hasNext()) { final float currentValue = sourceIterator.getFloatNext(); targetIterator.setShortNext((short) (currentValue * 100)); } } protected  FloatPercentToShort();   }### Answer:
@Test public void testApply() throws Exception { final Array sourceArray = Array.factory(new float[]{12.3f, 18.67f, 29.894f, 57.12345f}); final Array targetArray = Array.factory(short.class, sourceArray.getShape()); floatPercentToShort.apply(sourceArray, targetArray, null, null); assertEquals(1230, targetArray.getShort(0)); assertEquals(1867, targetArray.getShort(1)); assertEquals(2989, targetArray.getShort(2)); assertEquals(5712, targetArray.getShort(3)); }