Custom String sorting in Grid

How can I provide the equivalent functionality to a custom comparator to a Grid to use when sorting by a particular column?

For example, I’ve got a grid column that contains (HTML) strings generated from an underlying bean, and I’d like to sort by something other than basic alphebetical order. What’s the best way to go about doing this?

In Vaadin 7 I was using a custom ItemSorter on the underlying container, but this doesn’t seem to be supported anymore.

I’d thought of wrapping the strings in some custom object with an implementation of Comparable, but then I wouldn’t be able to use HtmlRenderer (unless I’m missing something?)

It is possible to set a custom comparator for each column in Vaadin 8.

Column<ITEM, COL> col = grid.addColumn(…);
col.setComparator(…);

Would this solve the problem?

-Pontus