VariableHelper { static int[] getIntVector(int length, int fillValue) { final int[] vector = new int[length]; if (fillValue != 0) { Arrays.fill(vector, fillValue); } return vector; }    }
@Test public void testGetFilledVector_ints_filled() { final int[] intVector = VariableHelper.getIntVector(15, -18); assertEquals(15, intVector.length); for (final int value : intVector) { assertEquals(-18, value); } }
@Test public void testGetFilledVector_ints_unfilled() { final int[] intVector = VariableHelper.getIntVector(14, 0); assertEquals(14, intVector.length); for (final int value : intVector) { assertEquals(0, value); } }