@Test
    public void testPageIteratorCloning() throws IOException, TesseractException {
        ImageAnalyzerFactory factory = TestContext.getImageAnaylzerFactory();
        try {
            ImageAnalyzer analyzer = TestContext.getImageAnalyzer(factory, TestContext.poetryImageFile);
            
            LayoutIterator blockIterator = analyzer.analyzeLayout();
            LayoutIterator lineIterator = blockIterator.copy();
            assertNotNull("Failed to create iterator", blockIterator);

            int blocks = 0;
            do {
                @SuppressWarnings("unused")
                BoundingBox box = blockIterator.getBoundingBox(Level.BLOCK);
                blocks++;
            } while (blockIterator.next(Level.BLOCK));
            
            assertEquals("Unexpected number of blocks", 3, blocks);
            blockIterator.close();
            
            int lines = 0;
            do {
                @SuppressWarnings("unused")
                BoundingBox box = lineIterator.getBoundingBox(Level.TEXTLINE);
                lines++;
            } while (lineIterator.next(Level.TEXTLINE));
            
            assertEquals("Unexpected number of lines", 22, lines);
            
            lineIterator.close();
            analyzer.close();
        } finally {
            if (factory != null)
                factory.close();
        }
    }