{
EnunciateFreemarkerModel model = new EnunciateFreemarkerModel();
FreemarkerModel.set(model);
final JsonTypeDefinition nameTypeDefinition = JsonTypeDefinition.createTypeDefinition((ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.json.Name"));
final JsonRootElementDeclaration rootElementDeclaration = new JsonRootElementDeclaration(nameTypeDefinition);
assertNull(model.findJsonRootElementDeclaration(rootElementDeclaration));
model.addJsonRootElement(rootElementDeclaration);
assertNotNull(model.findJsonRootElementDeclaration(rootElementDeclaration));
assertNotNull(model.findJsonTypeDefinition(nameTypeDefinition));