@Test
    public void testEmbeddedOfficeFiles() throws Exception {
        TrackingHandler handler;


        // Excel with a word doc and a powerpoint doc, both of which have images in them
        // Without recursion, should see both documents + the images
        handler = process("testEXCEL_embeded.xlsx", extractor, false);
        assertEquals(7, handler.filenames.size());
        assertEquals(7, handler.mediaTypes.size());

        // We know the rough filenames
        assertEquals("Microsoft_Office_PowerPoint_Presentation1.pptx", handler.filenames.get(0));
        assertEquals("Microsoft_Office_Word_97_-_2003_Document1.doc", handler.filenames.get(1));
        assertEquals("Microsoft_Office_Word_Document2.docx", handler.filenames.get(2));
        assertEquals("image1.png", handler.filenames.get(3));
        assertEquals("image2.emf", handler.filenames.get(4));
        assertEquals("image3.emf", handler.filenames.get(5));
        assertEquals("image4.emf", handler.filenames.get(6));
        // But we do know their types
        assertEquals(TYPE_PPTX, handler.mediaTypes.get(0)); // Embedded office doc
        assertEquals(TYPE_DOC, handler.mediaTypes.get(1));  // Embedded office doc
        assertEquals(TYPE_DOCX, handler.mediaTypes.get(2)); // Embedded office doc
        assertEquals(TYPE_PNG, handler.mediaTypes.get(3)); // Embedded image
        assertEquals(TYPE_EMF, handler.mediaTypes.get(4)); // Icon of embedded office doc
        assertEquals(TYPE_EMF, handler.mediaTypes.get(5)); // Icon of embedded office doc
        assertEquals(TYPE_EMF, handler.mediaTypes.get(6)); // Icon of embedded office doc


        // With recursion, should get the images embedded in the office files too
        handler = process("testEXCEL_embeded.xlsx", extractor, true);
        assertEquals(23 + 1 /*thumbnail */, handler.filenames.size());
        assertEquals(23 + 1 /*thumbnail */, handler.mediaTypes.size());


        assertEquals(TYPE_PPTX, handler.mediaTypes.get(0)); // Embedded office doc
        assertEquals(TYPE_EMF, handler.mediaTypes.get(1)); //   Icon of item inside .pptx
        assertEquals(TYPE_EMF, handler.mediaTypes.get(2)); //   Icon of item inside .pptx
        assertEquals(TYPE_EMF, handler.mediaTypes.get(3)); //   Icon of item inside .pptx
        assertEquals(TYPE_PNG, handler.mediaTypes.get(4));  //   PNG inside .pptx
        assertEquals(TYPE_GIF, handler.mediaTypes.get(5));  //   PNG inside .pptx
        assertEquals(TYPE_PNG, handler.mediaTypes.get(6));  //   PNG inside .pptx
        assertEquals(TYPE_XLSX, handler.mediaTypes.get(7)); //   .xlsx inside .pptx
        assertEquals(TYPE_PNG, handler.mediaTypes.get(8)); //     PNG inside .xlsx inside .pptx
        assertEquals(TYPE_DOCX, handler.mediaTypes.get(9)); //   .docx inside .pptx
        assertEquals(TYPE_PNG, handler.mediaTypes.get(10)); //     PNG inside .docx inside .pptx
        assertEquals(TYPE_JPG, handler.mediaTypes.get(11)); //     JPG inside .docx inside .pptx
        assertEquals(TYPE_PNG, handler.mediaTypes.get(12)); //     PNG inside .docx inside .pptx
        assertEquals(TYPE_DOC, handler.mediaTypes.get(13)); //   .doc inside .pptx
        assertEquals(TYPE_PNG, handler.mediaTypes.get(14)); //    PNG inside .doc inside .pptx
        assertEquals(TYPE_JPG, handler.mediaTypes.get(15));  // Embedded thumbnail
        assertEquals(TYPE_DOC, handler.mediaTypes.get(16));  // Embedded office doc
        assertEquals(TYPE_PNG, handler.mediaTypes.get(17));  //   PNG inside .doc
        assertEquals(TYPE_DOCX, handler.mediaTypes.get(18)); // Embedded office doc
        assertEquals(TYPE_PNG, handler.mediaTypes.get(19));  //   PNG inside .docx
        assertEquals(TYPE_PNG, handler.mediaTypes.get(20)); // Embedded image
        assertEquals(TYPE_EMF, handler.mediaTypes.get(21)); // Icon of embedded office doc
        assertEquals(TYPE_EMF, handler.mediaTypes.get(22)); // Icon of embedded office doc
        assertEquals(TYPE_EMF, handler.mediaTypes.get(23)); // Icon of embedded office doc


        // Word with .docx, powerpoint and excel
        handler = process("testWORD_embeded.docx", extractor, false);
        assertEquals(9, handler.filenames.size());
        assertEquals(9, handler.mediaTypes.size());

        // We know their rough filenames
        assertEquals("Microsoft_Office_PowerPoint_Presentation2.pptx", handler.filenames.get(0));
        assertEquals("image6.emf", handler.filenames.get(1));
        assertEquals("Microsoft_Office_Word_97_-_2003_Document1.doc", handler.filenames.get(2));
        assertEquals("image1.png", handler.filenames.get(3));
        assertEquals("image2.jpeg", handler.filenames.get(4));
        assertEquals("image3.png", handler.filenames.get(5));
        assertEquals("image4.emf", handler.filenames.get(6));
        assertEquals("Microsoft_Office_Excel_Worksheet1.xlsx", handler.filenames.get(7));
        assertEquals("image5.emf", handler.filenames.get(8));
        // But we do know their types
        assertEquals(TYPE_PPTX, handler.mediaTypes.get(0)); // Embedded office doc
        assertEquals(TYPE_EMF, handler.mediaTypes.get(1));  // Icon of embedded office doc
        assertEquals(TYPE_DOC, handler.mediaTypes.get(2));  // Embedded office doc
        assertEquals(TYPE_PNG, handler.mediaTypes.get(3));  // Embedded image
        assertEquals(TYPE_JPG, handler.mediaTypes.get(4));  // Embedded image
        assertEquals(TYPE_PNG, handler.mediaTypes.get(5));  // Embedded image
        assertEquals(TYPE_EMF, handler.mediaTypes.get(6));  // Icon of embedded office doc
        assertEquals(TYPE_XLSX, handler.mediaTypes.get(7)); // Embeded office doc
        assertEquals(TYPE_EMF, handler.mediaTypes.get(8));  // Icon of embedded office doc


        // With recursion, should get their images too
        handler = process("testWORD_embeded.docx", extractor, true);
        assertEquals(14 + 1 /* thumbnail */, handler.filenames.size());
        assertEquals(14 + 1 /* thumbnail */, handler.mediaTypes.size());

        // But we do know their types
        assertEquals(TYPE_PPTX, handler.mediaTypes.get(0)); // Embedded office doc
        assertEquals(TYPE_PNG, handler.mediaTypes.get(1));  //   PNG inside .pptx
        assertEquals(TYPE_GIF, handler.mediaTypes.get(2));  //   GIF inside .pptx
        assertEquals(TYPE_PNG, handler.mediaTypes.get(3));  //   PNG inside .pptx
        assertEquals(TYPE_JPG, handler.mediaTypes.get(4));  // Embedded thumbnail
        assertEquals(TYPE_EMF, handler.mediaTypes.get(5));  // Icon of embedded office doc
        assertEquals(TYPE_DOC, handler.mediaTypes.get(6));  // Embedded office doc
        assertEquals(TYPE_PNG, handler.mediaTypes.get(7));  //   PNG inside .doc
        assertEquals(TYPE_PNG, handler.mediaTypes.get(8));  // Embedded image
        assertEquals(TYPE_JPG, handler.mediaTypes.get(9));  // Embedded image
        assertEquals(TYPE_PNG, handler.mediaTypes.get(10));  // Embedded image
        assertEquals(TYPE_EMF, handler.mediaTypes.get(11));  // Icon of embedded office doc
        assertEquals(TYPE_XLSX, handler.mediaTypes.get(12)); // Embeded office doc
        assertEquals(TYPE_PNG, handler.mediaTypes.get(13));  //   PNG inside .xlsx
        assertEquals(TYPE_EMF, handler.mediaTypes.get(14)); // Icon of embedded office doc


        // PowerPoint with excel and word
        handler = process("testPPT_embeded.pptx", extractor, false);
        assertEquals(9 + 1 /* thumbnail */, handler.filenames.size());
        assertEquals(9 + 1 /* thumbnail */, handler.mediaTypes.size());

        // We don't know their exact filenames
        assertEquals("image1.emf", handler.filenames.get(0));
        assertEquals("image2.emf", handler.filenames.get(1));
        assertEquals("image3.emf", handler.filenames.get(2));
        assertEquals("image4.png", handler.filenames.get(3));
        assertEquals("image5.gif", handler.filenames.get(4));
        assertEquals("image6.png", handler.filenames.get(5));
        assertEquals("Microsoft_Office_Excel_Worksheet1.xlsx", handler.filenames.get(6));
        assertEquals("Microsoft_Office_Word_Document2.docx", handler.filenames.get(7));
        assertEquals("Microsoft_Office_Word_97_-_2003_Document1.doc", handler.filenames.get(8));
        assertEquals("/docProps/thumbnail.jpeg", handler.filenames.get(9));

        // But we do know their types
        assertEquals(TYPE_EMF, handler.mediaTypes.get(0));  // Icon of embedded office doc
        assertEquals(TYPE_EMF, handler.mediaTypes.get(1));  // Icon of embedded office doc
        assertEquals(TYPE_EMF, handler.mediaTypes.get(2));  // Icon of embedded office doc
        assertEquals(TYPE_PNG, handler.mediaTypes.get(3));  // Embedded image
        assertEquals(TYPE_GIF, handler.mediaTypes.get(4));  // Embedded image
        assertEquals(TYPE_PNG, handler.mediaTypes.get(5));  // Embedded image
        assertEquals(TYPE_XLSX, handler.mediaTypes.get(6)); // Embedded office doc
        assertEquals(TYPE_DOCX, handler.mediaTypes.get(7)); // Embedded office doc
        assertEquals(TYPE_DOC, handler.mediaTypes.get(8));  // Embedded office doc
    }
Office files which have other office files
embedded into them. The embedded office files
will sometimes have images in them.
<p/>
eg xls
-> word
-> image
-> image
-> powerpoint
-> excel
-> image
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/test/java/org/apache/tika/parser/microsoft/ooxml/OOXMLContainerExtractionTest.java