code: public static Basic2DMatrix block(Matrix a, Matrix b, Matrix c, Matrix d) {
          if ((a.rows() != b.rows()) || (a.columns() != c.columns()) ||
              (c.rows() != d.rows()) || (b.columns() != d.columns())) {
              throw new IllegalArgumentException("Sides of blocks are incompatible!");
          }
  
          int rows = a.rows() + c.rows();
          int columns = a.columns() + b.columns();
          double[][] array = new double[rows][columns];
  
          for (int i = 0; i < rows; i++) {
              for (int j = 0; j < columns; j++) {
                  if ((i < a.rows()) && (j < a.columns())) {
                      array[i][j] = a.get(i, j);
                  }
                  if ((i < a.rows()) && (j > a.columns())) {
                      array[i][j] = b.get(i, j);
                  }
                  if ((i > a.rows()) && (j < a.columns())) {
                      array[i][j] = c.get(i, j);
                  }
                  if ((i > a.rows()) && (j > a.columns())) {
                      array[i][j] = d.get(i, j);
                  }
              }
          }
  
          return new Basic2DMatrix(array);
      }
docs: Creates a block {@link Basic2DMatrix} of the given blocks {@code a},
  {@code b}, {@code c} and {@code d}.