ColumnIndexUtilities { public static int findUiColumnIndex(final List<GridColumn<?>> columns, final int modelColumnIndex) { for (int uiColumnIndex = 0; uiColumnIndex < columns.size(); uiColumnIndex++) { final GridColumn<?> c = columns.get(uiColumnIndex); if (c.getIndex() == modelColumnIndex) { return uiColumnIndex; } } throw new IllegalStateException("Column was not found!"); }  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 testFindUiColumnIndex() { assertEquals(3, ColumnIndexUtilities.findUiColumnIndex(columns, 0)); assertEquals(2, ColumnIndexUtilities.findUiColumnIndex(columns, 1)); assertEquals(1, ColumnIndexUtilities.findUiColumnIndex(columns, 2)); assertEquals(0, ColumnIndexUtilities.findUiColumnIndex(columns, 3)); }