code: public static <V> DenseGrid<V> create(V[][] array) {
          if (array == null) {
              throw new IllegalArgumentException("Array must not be null");
          }
          int rowCount = array.length;
          if (rowCount == 0) {
              return new DenseGrid<V>(0, 0);
          }
          int columnCount = array[0].length;
          for (int i = 1; i < rowCount; i++) {
              columnCount = Math.max(columnCount, array[i].length);
          }
          DenseGrid<V> created = DenseGrid.create(rowCount, columnCount);
          for (int row = 0; row < array.length; row++) {
              V[] rowValues = array[row];
              for (int column = 0; column < rowValues.length; column++) {
                  V cellValue = rowValues[column];
                  if (cellValue != null) {
                      created.values[row * columnCount + column] = cellValue;
                      created.size++;
                  }
              }
          }
          return created;
      }
docs: Creates a {@code DenseGrid} copying from an array.
  <p>
  The row count and column count are derived from the maximum size of the array.
  The grid is initialized from the non-null values.
  
  @param <V> the type of the value
  @param array  the array, first by row, then by column
  @return the mutable grid, not null