CSSParserFactory factory = CSSParserFactory.getDefaultInstance();
CSSParser parser = factory.createStrictParser();
StyleSheet styleSheet = parser.parseStyleSheet(reader, null);
StylingFactory stylingFactory = StylingFactory.getDefaultInstance();
CompilerConfiguration configuration =
stylingFactory.createCompilerConfiguration();
configuration.setSource(StyleSheetSource.THEME);
configuration.addFunctionResolver(functionResolverMock);
StyleSheetCompiler compiler =
stylingFactory.createStyleSheetCompiler(configuration);
CompiledStyleSheet compiledStyleSheet =
compiler.compileStyleSheet(styleSheet);
StylingEngine engine = stylingFactory.createStylingEngine();
engine.pushStyleSheet(compiledStyleSheet);
return engine;
}