ColumnIndexUtilities { @SuppressWarnings("unchecked") public static int getHeaderBlockStartColumnIndex(final List<GridColumn<?>> allColumns, final GridColumn.HeaderMetaData headerMetaData, final int headerRowIndex, final int headerColumnIndex) { int candidateHeaderColumnIndex = headerColumnIndex; if (candidateHeaderColumnIndex == 0) { return candidateHeaderColumnIndex; } while (candidateHeaderColumnIndex > 0) { final GridColumn candidateColumn = allColumns.get(candidateHeaderColumnIndex - 1); final List<GridColumn.HeaderMetaData> candidateHeaderMetaData = candidateColumn.getHeaderMetaData(); if (candidateHeaderMetaData.size() - 1 < headerRowIndex) { break; } if (!Objects.equals(candidateHeaderMetaData.get(headerRowIndex), headerMetaData)) { break; } candidateHeaderColumnIndex--; } return candidateHeaderColumnIndex; }  static int findUiColumnIndex(final List<GridColumn<?>> columns,
                                        final int modelColumnIndex); @SuppressWarnings("unchecked") static int getHeaderBlockStartColumnIndex(final List<GridColumn<?>> allColumns,
                                                     final GridColumn.HeaderMetaData headerMetaData,
                                                     final int headerRowIndex,
                                                     final int headerColumnIndex); @SuppressWarnings("unchecked") static int getHeaderBlockEndColumnIndex(final List<GridColumn<?>> allColumns,
                                                   final GridColumn.HeaderMetaData headerMetaData,
                                                   final int headerRowIndex,
                                                   final int headerColumnIndex); static int getMaxUiHeaderRowIndexOfColumn(final GridData model, final int uiColumnIndex);  }
@Test public void testGetHeaderBlockStartColumnIndex() { assertEquals(0, ColumnIndexUtilities.getHeaderBlockStartColumnIndex(columns, columns.get(3).getHeaderMetaData().get(0), 0, 3)); }
@Test public void testGetHeaderBlockStartColumnIndexWithSplitBlock() { columns.get(1).getHeaderMetaData().get(0).setColumnGroup("new-group"); assertEquals(2, ColumnIndexUtilities.getHeaderBlockStartColumnIndex(columns, columns.get(3).getHeaderMetaData().get(0), 0, 3)); }