GraphicsDocument extends Document { @Override public OfficeDrawingElement getContentRoot() throws Exception { return super.getContentRoot(OfficeDrawingElement.class); } protected  GraphicsDocument(OdfPackage pkg, String internalPath, GraphicsDocument.OdfMediaType odfMediaType); static GraphicsDocument newGraphicsDocument(); static GraphicsDocument newGraphicsTemplateDocument(); static GraphicsDocument loadDocument(InputStream inputStream); static GraphicsDocument loadDocument(String documentPath); static GraphicsDocument loadDocument(File file); @Override OfficeDrawingElement getContentRoot(); void changeMode(OdfMediaType mediaType); OdfElement getTableContainerElement();  }
@Test public void testGetContentRoot() throws Exception { try { String filePath = ResourceUtilities.getAbsolutePath(TEST_FILE); FileInputStream fStream = new FileInputStream(new File(filePath)); GraphicsDocument gdoc = GraphicsDocument.loadDocument(fStream); Assert.assertNotNull(gdoc); OfficeDrawingElement officeEle = gdoc.getContentRoot(); Assert.assertNotNull(officeEle); Assert.assertEquals("office:drawing", officeEle.getNodeName()); } catch (Exception e) { LOG.log(Level.SEVERE, e.getMessage(), e); Assert.fail(e.getMessage()); } }