@Test
    public void testDuplicateAnalyzerMethods() throws IOException, TesseractException {
        // HACK: this will be impossible to maintain. Need a better way to identify and 
        //       test methods that should fail (possibly reflection)
        ImageAnalyzerFactory factory = TestContext.getImageAnaylzerFactory();
        try {
            ImageAnalyzer analyzer = TestContext.getImageAnalyzer(factory, TestContext.poetryImageFile);
            LayoutIterator blockIterator = analyzer.analyzeLayout();
            
            // try to create other iterators and manipulate factory while iterator is open
            LayoutIterator badIterator;
            try {
                badIterator = analyzer.analyzeLayout();
                assertFalse("Was able to create duplicate iterator. Should have thrown an exception", true);
                badIterator.close();
            } catch (Exception ex) { /* expected */ }
            
            try {
                badIterator = analyzer.analyzeLayout(new Rectangle(50, 50));
                assertFalse("Was able to create duplicate iterator. Should have thrown an exception", true);
                badIterator.close();
            } catch (Exception ex) { /* expected */ }
            
            try {
                badIterator = analyzer.recognize();
                assertFalse("Was able to create duplicate iterator. Should have thrown an exception", true);
                badIterator.close();
            } catch (Exception ex) { /* expected */ }
            
            try {
                badIterator = analyzer.recognize(new Rectangle(50, 50));
                assertFalse("Was able to create duplicate iterator. Should have thrown an exception", true);
                badIterator.close();
            } catch (Exception ex) { /* expected */ }
            
            blockIterator.close();
            analyzer.close();
        } finally {
            if (factory != null)
                factory.close();
        }
    }