### Question:
BoxLayout extends Layout { public LayoutModel getDataForScreen(int screenNr, List<OutputMapping> ioMapping) { int visualId = ioMapping.get(screenNr).getVisualId(); int fxOnHowMayScreensX=this.howManyScreensShareThisFxOnTheXAxis(visualId, ioMapping); int fxOnHowMayScreensY=this.howManyScreensShareThisFxOnTheYAxis(visualId, ioMapping); return new LayoutModel( fxOnHowMayScreensX, fxOnHowMayScreensY, this.getXOffsetForScreen(screenNr, fxOnHowMayScreensX, visualId, ioMapping), this.getYOffsetForScreen(screenNr, fxOnHowMayScreensY), visualId); } BoxLayout(int row1Size, int row2Size); LayoutModel getDataForScreen(int screenNr, List<OutputMapping> ioMapping);  }### Answer:
@Test public void basicTest() throws Exception { final int panels = 2; Layout l = new BoxLayout(panels, panels); assertEquals(panels, l.getRow1Size()); assertEquals(panels, l.getRow2Size()); assertEquals(Layout.LayoutName.BOX, l.getLayoutName()); MatrixData matrix = new MatrixData(8, 8); IFader fader = new Switch(matrix, 50); List<OutputMapping> ioMapping = new ArrayList<OutputMapping>(); for (int n=0; n<panels+panels; n++) { ioMapping.add(new OutputMapping(fader, n)); } LayoutModel lom0 = l.getDataForScreen(0, ioMapping); assertEquals(0, lom0.getOfsX()); assertEquals(0, lom0.getOfsY()); assertEquals(1, lom0.getSameFxOnX()); assertEquals(1, lom0.getSameFxOnY()); assertEquals(0, lom0.getVisualId()); assertEquals(true, lom0.screenDoesNotNeedStretching()); ioMapping.clear(); for (int n=0; n<panels+panels; n++) { ioMapping.add(new OutputMapping(fader, 0)); } lom0 = l.getDataForScreen(0, ioMapping); assertEquals(0, lom0.getOfsX()); assertEquals(0, lom0.getOfsY()); assertEquals(panels, lom0.getSameFxOnX()); assertEquals(panels, lom0.getSameFxOnY()); assertEquals(0, lom0.getVisualId()); assertEquals(false, lom0.screenDoesNotNeedStretching()); ioMapping.get(1).setVisualId(1); ioMapping.get(3).setVisualId(1); lom0 = l.getDataForScreen(0, ioMapping); assertEquals(0, lom0.getOfsX()); assertEquals(0, lom0.getOfsY()); assertEquals(1, lom0.getSameFxOnX()); assertEquals(panels, lom0.getSameFxOnY()); assertEquals(0, lom0.getVisualId()); assertEquals(false, lom0.screenDoesNotNeedStretching()); }