### Question:
Board { public String paint(int width, int height) { StringBuilder screen = new StringBuilder(); String ln = System.lineSeparator(); for (int currentHeight = 0; currentHeight < height; currentHeight++) { for (int currentWidth = 0; currentWidth < width; currentWidth++) { if ((currentWidth + currentHeight) % 2 == 0) { screen.append("x"); } else { screen.append(" "); } } screen.append(ln); } return screen.toString(); }  String paint(int width, int height);  }### Answer:
@Test public void whenPaintBoardWithWidthThreeAndHeightThreeThenStringWithThreeColsAndThreeRows() { Board board = new Board(); String result = board.paint(3, 3); final String line = System.getProperty("line.separator"); String expected = String.format("x x%s x %sx x%s", line, line, line); assertThat(result, is(expected)); }
@Test public void whenPaintBoardWithWidthFiveAndHeightFiveThenStringWithFiveColsAndFiveRows() { Board board = new Board(); String result = board.paint(5, 5); final String line = System.getProperty("line.separator"); String expected = String.format("x x x%s x x %sx x x%s x x %sx x x%s", line, line, line, line, line); assertThat(result, is(expected)); }