### Question:
CssDefinitionFileGenerator extends SpecialFileGenerator { @Override public CssResult generate(Class<?> javaClass) throws SingleFileGeneratorException { Map<String, String> cssDefinitions = new HashMap<>(); StjsJavaScriptClassBuilder builder = new StjsJavaScriptClassBuilder(javaClass) .constructor(javaClass) ._constructor(); String styleScope = javaClass.getAnnotation(StyleScopeClass.class) != null ? "." + javaClass.getAnnotation(StyleScopeClass.class).value() + " " : ""; for(Field field : javaClass.getDeclaredFields()) { if(field.getType().equals(String.class)) { String value; try { value = (String) field.get(null); } catch (IllegalArgumentException | IllegalAccessException ex) { throw new SingleFileGeneratorException(ex, null); } if(field.getAnnotation(NoRule.class) == null) { String styleName = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, field.getName()); cssDefinitions.put(styleScope + "." + styleName, "{" + value + "}"); value = styleName; } builder.staticVariable(javaClass, field.getName()).literal(value).semicolon().newLine(); } } return new CssResult(builder.create(), cssDefinitions); }  @Override CssResult generate(Class<?> javaClass); @Override boolean isGeneratable(Class<?> javaClass);  }### Answer:
@Test public void generate() throws SingleFileGeneratorException { CssDefinitionFileGenerator generator = new CssDefinitionFileGenerator(); CssResult result = generator.generate(TestCssDefinition.class); assertThat(result.getSource(), containsString(".HEADING")); assertThat(result.getSource(), containsString("'heading'")); assertThat(result.getSource(), containsString(".COLOR_HIGHLIGHT")); assertThat(result.getSource(), containsString("'colorHighlight'")); assertThat(result.getCssDefinitions(), hasKey(".heading")); assertThat(result.getCssDefinitions(), hasKey(".colorHighlight")); }