### Question:
XMLFactory { @Nonnull public static Document newDocument () { return newDocument (getDocumentBuilder (), (EXMLVersion) null); } private  XMLFactory(); static void reinitialize(); @Nonnull static DocumentBuilderFactory createDefaultDocumentBuilderFactory(); @Nonnull static DocumentBuilderFactory createDocumentBuilderFactory(@Nonnull final Schema aSchema); @Nonnull static DocumentBuilderFactory getDocumentBuilderFactory(); @Nonnull static DocumentBuilder getDocumentBuilder(); @Nonnull static DOMImplementation getDOMImplementation(); @Nonnull static DocumentBuilder createDocumentBuilder(); @Nonnull static DocumentBuilder createDocumentBuilder(@Nonnull final Schema aSchema); @Nonnull static DocumentBuilder createDocumentBuilder(@Nonnull final DocumentBuilderFactory aDocBuilderFactory); @Nonnull static Document newDocument(); @Nonnull static Document newDocument(@Nonnull final DocumentBuilder aDocBuilder); @Nonnull static Document newDocument(@Nullable final EXMLVersion eVersion); @Nonnull static Document newDocument(@Nonnull final DocumentBuilder aDocBuilder, @Nullable final EXMLVersion eVersion); @Nonnull static Document newDocument(@Nonnull final String sQualifiedName,
                                      @Nullable final String sPublicId,
                                      @Nullable final String sSystemId); @Nonnull static Document newDocument(@Nullable final EXMLVersion eVersion,
                                      @Nonnull final String sQualifiedName,
                                      @Nullable final String sPublicId,
                                      @Nullable final String sSystemId); @Nonnull static Document newDocument(@Nonnull final DocumentBuilder aDocBuilder,
                                      @Nullable final EXMLVersion eVersion,
                                      @Nonnull final String sQualifiedName,
                                      @Nullable final String sPublicId,
                                      @Nullable final String sSystemId); static final boolean DEFAULT_DOM_NAMESPACE_AWARE; static final boolean DEFAULT_DOM_VALIDATING; static final boolean DEFAULT_DOM_IGNORING_ELEMENT_CONTENT_WHITESPACE; static final boolean DEFAULT_DOM_EXPAND_ENTITY_REFERENCES; static final boolean DEFAULT_DOM_IGNORING_COMMENTS; static final boolean DEFAULT_DOM_COALESCING; static final boolean DEFAULT_DOM_XINCLUDE_AWARE; }### Answer:
@Test public void testNewDocument () { Document doc = XMLFactory.newDocument (); assertNotNull (doc); assertNull (doc.getDoctype ()); assertNull (doc.getDocumentElement ()); assertEquals (EXMLVersion.XML_10.getVersion (), doc.getXmlVersion ()); doc = XMLFactory.newDocument (EXMLVersion.XML_11); assertNotNull (doc); assertNull (doc.getDoctype ()); assertNull (doc.getDocumentElement ()); assertEquals (EXMLVersion.XML_11.getVersion (), doc.getXmlVersion ()); doc = XMLFactory.newDocument ("qname", null, null); assertNotNull (doc); assertNotNull (doc.getDoctype ()); assertEquals ("qname", doc.getDoctype ().getName ()); assertNull (doc.getDoctype ().getPublicId ()); assertNull (doc.getDoctype ().getSystemId ()); assertNotNull (doc.getDocumentElement ()); assertEquals ("qname", doc.getDocumentElement ().getTagName ()); assertEquals (EXMLVersion.XML_10.getVersion (), doc.getXmlVersion ()); doc = XMLFactory.newDocument (EXMLVersion.XML_11, "qname", "pubid", "sysid"); assertNotNull (doc); assertNotNull (doc.getDoctype ()); assertEquals ("qname", doc.getDoctype ().getName ()); assertEquals ("pubid", doc.getDoctype ().getPublicId ()); assertEquals ("sysid", doc.getDoctype ().getSystemId ()); assertNotNull (doc.getDocumentElement ()); assertEquals ("qname", doc.getDocumentElement ().getTagName ()); assertEquals (EXMLVersion.XML_11.getVersion (), doc.getXmlVersion ()); }