#vulnerable code 
                                @Test
    public void testReadThumbsCatalogFile() throws IOException {
        CompoundDocument document = createTestDocument();

        Entry root = document.getRootEntry();

        assertNotNull(root);
        assertEquals(25, root.getChildEntries().size());

        Entry catalog = root.getChildEntry("Catalog");

        assertNotNull(catalog);
        assertNotNull("Input stream may not be null", catalog.getInputStream());
    } 
                            #location 14 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testReadThumbsCatalogFile() throws IOException {
        try (CompoundDocument document = createTestDocument()) {
            Entry root = document.getRootEntry();

            assertNotNull(root);
            assertEquals(25, root.getChildEntries().size());

            Entry catalog = root.getChildEntry("Catalog");

            assertNotNull(catalog);
            assertNotNull("Input stream may not be null", catalog.getInputStream());
        }
    }