### Question:
MatrixData { public int[] getScreenBufferForDevice(Visual visual, OutputMapping map) { int[] buffer = visual.getBuffer(); buffer = doTheFaderBaby(buffer, map); return resizeBufferForDevice(buffer, visual.getResizeOption(), deviceXSize, deviceYSize); } MatrixData(int deviceXSize, int deviceYSize); int[] getScreenBufferForDevice(Visual visual, OutputMapping map); int[] getScreenBufferForDevice(Visual visual, LayoutModel lm, OutputMapping map, IOutput output); int[] resizeBufferForDevice(int[] buffer, ResizeName resizeName, int deviceXSize, int deviceYSize); int getDeviceXSize(); int getDeviceYSize(); int getBufferXSize(); int getBufferYSize(); int getDeviceSize(); @Override String toString();  }### Answer:
@Test public void testMatrixStretch() { Properties config = new Properties(); config.put(ConfigConstant.NULLOUTPUT_ROW1, "2"); config.put(ConfigConstant.NULLOUTPUT_ROW2, "2"); ApplicationConfigurationHelper ph = new ApplicationConfigurationHelper(config); Output output = new NullDevice(ph); FileUtils fileUtils = new FileUtils(); Collector.getInstance().init(fileUtils, ph); Mixer m = new PassThruMixer(); ColorSet c = new ColorSet("JUNIT", new int[]{123233,232323,100,200}); LayoutModel lmDefault = new LayoutModel(1, 1, 0, 0, 0); LayoutModel lmBox1 = new LayoutModel(2, 1, 0, 0, 0); LayoutModel lmBox2 = new LayoutModel(2, 1, 32, 32, 0); LayoutModel lmBox4 = new LayoutModel(2, 2, 32, 32, 0); for (int y=1; y<38; y++) { for (int x=1; x<38; x++) { MatrixData matrix = new MatrixData(x,y); Generator g = new Fire(matrix); Effect e = new PassThru(matrix); Visual visual = new Visual(g, e, m, c); IFader fader = new Switch(matrix, 100); OutputMapping map = new OutputMapping(fader, 0); assertNotNull(matrix.getScreenBufferForDevice(visual, map)); assertNotNull(matrix.getScreenBufferForDevice(visual, lmDefault, map, output)); assertNotNull(matrix.getScreenBufferForDevice(visual, lmBox1, map, output)); assertNotNull(matrix.getScreenBufferForDevice(visual, lmBox2, map, output)); assertNotNull(matrix.getScreenBufferForDevice(visual, lmBox4, map, output)); } } }