String exampleRef= "hello:world";
String exampleDesc = "example description";
String example = "<aura:example name='"+exampleName+"' ref='"+exampleRef+"' label='"+exampleLabel+"'>"+exampleDesc+"</aura:example>";
String docDefSource = "<aura:documentation><aura:description>"+description+"</aura:description>"+example+"</aura:documentation>";
DocumentationDef dd = parse(docDefSource);
dd.validateDefinition();
List<ExampleDef> descDefs = dd.getExampleDefs();
assertEquals(1, descDefs.size());
ExampleDef ed = descDefs.get(0);
assertEquals(exampleLabel, ed.getLabel());
assertEquals(exampleName, ed.getName());
assertEquals(exampleRef, ed.getRef().getNamespace()+":"+ed.getRef().getName());