code: @SuppressWarnings("unchecked")
      public static <V> DenseGrid<V> create(Grid<? extends V> grid) {
          if (grid == null) {
              throw new IllegalArgumentException("Grid must not be null");
          }
          if (grid instanceof DenseImmutableGrid) {
              return new DenseGrid<V>((DenseImmutableGrid<V>) grid);
          }
          DenseGrid<V> created = DenseGrid.create(grid.rowCount(), grid.columnCount());
          created.putAll(grid);
          return created;
      }
docs: Creates a {@code DenseGrid} copying from another grid.
  
  @param <V> the type of the value
  @param grid  the grid to copy, not null
  @return the mutable grid, not null