code: public void addGroupedColumn(int columnIndex) {
          int[][] newColGroups = getColumnGroups();
          // Create a group if none exists.
          if (newColGroups.length == 0) {
              newColGroups = new int[][]{{columnIndex}};
          } else {
              int lastGroupIndex = newColGroups.length - 1;
              int[] lastGroup = newColGroups[lastGroupIndex];
              int groupSize = lastGroup.length;
              int[] newLastGroup = new int[groupSize + 1];
              System.arraycopy(lastGroup, 0, newLastGroup, 0, groupSize);
              newLastGroup[groupSize] = columnIndex;
              newColGroups[lastGroupIndex] = newLastGroup;
          }
          setColumnGroups(newColGroups);
      }
docs: Adds the specified column index to the last column group. In case there are no groups, a new
  group will be created.
  
  @param columnIndex	the column index to be set grouped