package com.java.laiy.model;

import com.java.laiy.helpers.CoordinateHelper;

public class Board {

    private static final int DEFAULT_BOARD_SIZE = 3;

    private final Figure[][] figures;

    public Board() {
        this(DEFAULT_BOARD_SIZE);
    }

    public Board(final int customBoardSize) {
        if (customBoardSize < DEFAULT_BOARD_SIZE) {
            this.figures = new Figure[DEFAULT_BOARD_SIZE][DEFAULT_BOARD_SIZE];
        }
         else {
            this.figures = new Figure[customBoardSize][customBoardSize];
        }
    }

    public boolean setFigure(final int x, final int y, final Figure figure) {
        if (!CoordinateHelper.checkCoordinate(x) || !CoordinateHelper.checkCoordinate(y) || figures[x][y] != null)  {
            return false;
        }
        else {
            figures[x][y] = figure;
            return true;
        }
    }

    public Figure getFigure(final int x, final int y) {
        if (!CoordinateHelper.checkCoordinate(x) || !CoordinateHelper.checkCoordinate(y)) {
            return null;
        }
        else {
            return figures[x][y];
        }
    }

    public Figure[][] getFiguresArray() {
            return figures;
    }

    public int getRowLength(final int row) {
        return figures[row].length;
    }

}
@@ -122,24 +122,16 @@
 nal int 
-DEFAULT_
 BOARD_SI
@@ -151,22 +151,16 @@
 private 
-final 
 Figure%5B%5D
@@ -173,53 +173,34 @@
 ures
-;%0A%0A    public Board() %7B%0A        this(DEFAULT_
+ = new Figure%5BBOARD_SIZE%5D%5B
 BOAR
@@ -209,16 +209,10 @@
 SIZE
-);%0A    %7D
+%5D;
 %0A%0A  
@@ -230,85 +230,26 @@
 ard(
-final int customBoardSize) %7B%0A        if (customBoardSize %3C DEFAULT_BOARD_SIZE
+Figure%5B%5D%5B%5D figures
 ) %7B%0A
@@ -256,33 +256,31 @@
         
-    this.
+assert 
 figures 
 = new Fi
@@ -275,170 +275,48 @@
 res 
+!
 = n
-ew Figure%5BDEFAULT_BOARD_SIZE%5D%5BDEFAULT_BOARD_SIZE%5D;%0A        %7D%0A         else %7B%0A            this.figures = new Figure%5BcustomBoardSize%5D%5BcustomBoardSize%5D;%0A        %7D
+ull;%0A        this.figures = figures;
 %0A   
@@ -1059,8 +1059,9 @@
     %7D%0A%0A%7D
+%0A

Update Board.java