Board implements Cloneable { public boolean areValidCoordinates(int row, int col) { if (row >= getRows() || row < 0) { return false; } else if (col >= getCols() || col < 0) { return false; } return true; } Board(int rows, int cols);  Board(int[][] board); void setCellState(int row, int col, int state); int getCellSate(int row, int col); boolean areValidCoordinates(int row, int col); int getTotalSize(); int getRows(); int getCols(); boolean isBottomRightAlive(int row, int col); boolean isBottomAlive(int row, int col); boolean isBottomLeftAlive(int row, int col); boolean isRightAlive(int row, int col); boolean isLeftAlive(int row, int col); boolean isTopRightAlive(int row, int col); boolean isTopAlive(int row, int col); boolean isTopLeftAlive(int row, int col); int getAliveNeighbours(int row, int col); @Override Board clone(); @Override String toString();  }
@Test public void invalidCoordinates_shouldReturnFalse() { Board board = new Board(3, 3); Assert.assertEquals("Top left invalid", false, board.areValidCoordinates(-1, -1)); Assert.assertEquals("Top invalid", false, board.areValidCoordinates(-1, 0)); Assert.assertEquals("Top right invalid", false, board.areValidCoordinates(-1, 3)); Assert.assertEquals("Right invalid", false, board.areValidCoordinates(0, 3)); Assert.assertEquals("Left invalid", false, board.areValidCoordinates(0, -1)); Assert.assertEquals("Bottom Left invalid", false, board.areValidCoordinates(3, -1)); Assert.assertEquals("Bottom invalid", false, board.areValidCoordinates(3, -1)); Assert.assertEquals("Center ok", true, board.areValidCoordinates(1, 1)); Assert.assertEquals("Bottom Left ok", true, board.areValidCoordinates(2, 0)); Assert.assertEquals("Bottom Right ok", true, board.areValidCoordinates(2, 2)); Assert.assertEquals("Top Right ok", true, board.areValidCoordinates(0, 2)); Assert.assertEquals("Top Left ok", true, board.areValidCoordinates(0, 0)); }