@Test
public void testSingleCloseDoc() throws Exception {

    //TIKA-1341
    Metadata m = new Metadata();
    ParseContext c = new ParseContext();
    ContentHandler h = new EventCountingHandler();
    try(InputStream is = PDFParserTest.class.getResourceAsStream(
            "/test-documents/testPDFTripleLangTitle.pdf")) {
        AUTO_DETECT_PARSER.parse(is, h, m, c);
    }
    assertEquals(1, ((EventCountingHandler) h).getEndDocument());
}