Pragmatically add themeName for html component

I’m using jmix 2.6 and I want to use themeNames for a span thaht I instaciate pragmaticaly,
I can use addClassNames but it appear there are no addThemeNames method
How to do it ?
Best regards

Ok I have found a solution here https://demo.jmix.io/ui-samples/sample/badge-theme-variant?tab=BadgeThemeVariantSample.java