@Test
    public void testNestedEntries() throws SAXException {
        AttributesImpl atts = new AttributesImpl();
        atts.addAttribute("", "class", "class", "CDATA", "package-entry");
        for (int i = 1; i < handler.getMaximumPackageEntryDepth(); i++) {
            handler.startElement("", "div", "div", atts);
        }
        try {
            handler.startElement("", "div", "div", atts);
            fail("Nested XML element limit exceeded");
        } catch (SAXException e) {
            try {
                handler.throwIfCauseOf(e);
                throw e;
            } catch (TikaException expected) {
            }
        }
    }
Tests for the {@link SecureContentHandler} class.
tika-core/src/test/java/org/apache/tika/sax/SecureContentHandlerTest.java