public static int getColumnIndex(@NotNull JTableHeader header, @Nullable TableColumn column) {
    if (column == null) return -1;
    TableColumnModel model = header.getColumnModel();
    if (model == null) return -1;
    int index = model.getColumnCount();
    while (0 < index--) {
      if (column == model.getColumn(index)) break;
    }
    return index;
  }
public static int getColumnIndex(@NotNull JTableHeader header, @Nullable TableColumn column)