VariableHelper { static short[] getShortVector(int length, short fillValue) { final short[] vector = new short[length]; if (fillValue != (short) 0) { Arrays.fill(vector, fillValue); } return vector; }    }
@Test public void testGetFilledVector_shorts_filled() { final short[] intVector = VariableHelper.getShortVector(17, (short) -567); assertEquals(17, intVector.length); for (final short value : intVector) { assertEquals((short)-567, value); } }
@Test public void testGetFilledVector_shorts_unfilled() { final short[] shortVector = VariableHelper.getShortVector(18, (short)0); assertEquals(18, shortVector.length); for (final short value : shortVector) { assertEquals((short)0, value); } }