GraphicsDocument extends Document { public OdfElement getTableContainerElement() { throw new UnsupportedOperationException("Graphics document is not supported to hold table now."); } 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 testGetTableContainerElement() throws Exception { String filePath = ResourceUtilities.getAbsolutePath(TEST_FILE); File otg = new File(filePath); FileInputStream fStream = new FileInputStream(otg); GraphicsDocument gdoc = GraphicsDocument.loadDocument(fStream); Assert.assertNotNull(gdoc); Assert.assertEquals("application/vnd.oasis.opendocument.graphics-template", gdoc.getMediaTypeString()); try { gdoc.getTableContainerElement(); } catch (Exception e) { Assert.assertTrue(e instanceof UnsupportedOperationException); Assert.assertEquals("Graphics document is not supported to hold table now.", e.getMessage()); } }