#fixed code
                                @Test
    public void shouldReturnTheResourceForAClass() throws IOException {
        ConfigURLStreamHandler handler = new ConfigURLStreamHandler(SampleConfig.class.getClassLoader(),
                new SystemVariablesExpander());
        ConfigURLStreamHandler spy = spy(handler);

        ConfigFactory.getPropertiesFor(SampleConfig.class, spy);
        URL expected =
                new URL(null, "classpath:org/aeonbits/owner/SampleConfig.properties", handler);
        verify(spy, times(1)).openConnection(eq(expected));
    }
#vulnerable code 
                                @Test
    public void shouldReturnTheResourceForAClass() throws IOException {
        ConfigURLStreamHandler handler = new ConfigURLStreamHandler(SampleConfig.class.getClassLoader(),
                new SystemVariablesExpander());
        ConfigURLStreamHandler spy = spy(handler);

        ConfigFactory.getStreamFor(SampleConfig.class, spy);
        URL expected =
                new URL(null, "classpath:org/aeonbits/owner/SampleConfig.properties", handler);
        verify(spy, times(1)).openConnection(eq(expected));
    } 
                            #location 7 
                            #vulnerability type RESOURCE_LEAK