code: public void setColumnGroups(int[][] colGroupIndices) {
          int maxColumn = getColumnCount();
          boolean[] usedIndices = new boolean[maxColumn + 1];
          for (int group = 0; group < colGroupIndices.length; group++) {
              for (int j = 0; j < colGroupIndices[group].length; j++) {
                  int colIndex = colGroupIndices[group][j];
                  if (colIndex < 1 || colIndex > maxColumn) {
                      throw new IndexOutOfBoundsException(
                              "Invalid column group index " + colIndex
                              + " in group " + (group + 1));
                  }
                  if (usedIndices[colIndex]) {
                      throw new IllegalArgumentException(
                              "Column index " + colIndex + " must not be used in multiple column groups.");
                  }
                  usedIndices[colIndex] = true;
              }
          }
          this.colGroupIndices = deepClone(colGroupIndices);
      }
docs: Sets the column groups, where each column in a group gets the same group wide width. Each
  group is described by an array of integers that are interpreted as column indices. The
  parameter is an array of such group descriptions.<p>
  
  <strong>Examples:</strong><pre>
  // Group columns 1, 3 and 4.
  setColumnGroups(new int[][]{ {1, 3, 4}});
  
  // Group columns 1, 3, 4, and group columns 7 and 9
  setColumnGroups(new int[][]{ {1, 3, 4}, {7, 9}});
  </pre>
  
  @param colGroupIndices	a two-dimensional array of column groups indices
  @throws	IndexOutOfBoundsException if an index is outside the grid
  @throws IllegalArgumentException if a column index is used twice