List declarations = docType.getInternalDeclarations();
assertTrue("DOCTYPE has declarations", (declarations != null)
&& !declarations.isEmpty());
ElementDecl decl = (ElementDecl) declarations.get(0);
assertEquals("name is correct", "greeting", decl.getName());
assertEquals("model is correct", "(#PCDATA)", decl.getModel());
String expected = "<!ELEMENT " + decl.getName() + " " + decl.getModel()
+ ">";
assertEquals("toString() is correct", expected, decl.toString());
}