#vulnerable code 
                                @Test(expected = UnsupportedOperationException.class)
    public void whenVersionIsNotSupportedShouldThrowException() throws IOException {
        KeePassHeader header = new KeePassHeader(new RandomGenerator());
        
        // new v4 format
        FileInputStream fileInputStream = new FileInputStream(ResourceUtils.getResource("DatabaseWithV4Format.kdbx"));
        byte[] rawHeader = StreamUtils.toByteArray(fileInputStream);
        
        header.checkVersionSupport(rawHeader);
    } 
                            #location 7 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test(expected = UnsupportedOperationException.class)
    public void whenVersionIsNotSupportedShouldThrowException() throws IOException {
        KeePassHeader header = new KeePassHeader(new RandomGenerator());
        
        // unsupported format --> e.g. v5
        byte[] rawHeader = ByteUtils.hexStringToByteArray("03D9A29A67FB4BB501000500");
        
        header.checkVersionSupport(rawHeader);
    }