there is a `CategoryUtil` static method that does this, I believe.