VariableHelper { static int[][] getIntArray(int width, int height, int fillValue) { final int[][] intArray = new int[width][height]; if (fillValue != 0) { for (int i = 0; i < width; i++) { Arrays.fill(intArray[i], fillValue); } } return intArray; }    }
@Test public void testGetFilledArray_ints_filled() { final int width = 5; final int height = 3; final int[][] array = VariableHelper.getIntArray(width, height, 11); assertEquals(width, array.length); assertEquals(height, array[0].length); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { assertEquals(11, array[i][j]); } } }
@Test public void testGetFilledArray_ints_unfilled() { final int width = 6; final int height = 2; final int[][] array = VariableHelper.getIntArray(width, height, 0); assertEquals(width, array.length); assertEquals(height, array[0].length); for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { assertEquals(0, array[i][j]); } } }