@Test
    public void testOpenCloseUseAnalyzer() {
        BufferedImage image = null;
        
        // Open and immediately close the image analyzer factory.
        // This should be just fine
        try {
            factory = ImageAnalyzerFactory.createFactory(dataDir);
            factory.close();
        } catch (Exception ex) {
            assertFalse("Could not open and imediately close the analyzer factory: " + ex.getMessage(), true);
        }
            
        // sanity checks on the image file
        assertTrue("Test image does not exist", testImageFile.exists());
        assertTrue("Test image is not readable", testImageFile.canRead());
        assertTrue("Test image is not a file", testImageFile.isFile());
        
        try {
            image = ImageIO.read(testImageFile);
            assertNotNull("Could not load test image", image);
        } catch (IOException ex) {
            assertFalse("Failed to load test image: " + ex.getMessage(), true);
        }
            
        try {
            // This should throw an exception. In the buggy behavior, this is causing a 
            // seg fault because the factory attempts to create the analyzer even though 
            // the factory has been closed.
            analyzer = factory.createImageAnalyzer(image);
            assertFalse("Was able to construct an ImageAnalyzer from a closed factory", true);
        } catch (Exception ex) {
            // this is the desired behavior.
            analyzer = null;
        }
        
        // we succeeded an have already shut this down
        factory = null;
    }