#vulnerable code 
                                @Test
    @Ignore("Slow test. Uses actual data.")
    public void suggestWordTest() throws IOException, URISyntaxException {
        TurkishMorphology morphology = TurkishMorphology.createWithDefaults();
        TurkishSpellChecker spellChecker = new TurkishSpellChecker(morphology);

        Path lmPath = Paths.get(ClassLoader.getSystemResource("lm-unigram.slm").toURI());
        NgramLanguageModel lm = SmoothLm.builder(lmPath.toFile()).build();

        Path r = Paths.get(ClassLoader.getSystemResource("10000_frequent_turkish_word").toURI());

        List<String> words = Files.readAllLines(r, StandardCharsets.UTF_8);
        int c = 0;
        Stopwatch sw = Stopwatch.createStarted();
        for (String word : words) {
            List<String> suggestions = spellChecker.suggestForWord(word, lm);
            c += suggestions.size();
        }
        Log.info("Elapsed = %d count = %d ", sw.elapsed(TimeUnit.MILLISECONDS), c);

    } 
                            #location 8 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    @Ignore("Slow test. Uses actual data.")
    public void suggestWordTest() throws IOException, URISyntaxException {
        TurkishMorphology morphology = TurkishMorphology.createWithDefaults();
        TurkishSpellChecker spellChecker = new TurkishSpellChecker(morphology);

        Log.info("Node count = %d", spellChecker.decoder.getGraph().getAllNodes().size());
        Log.info("Node count with single connection= %d",
                spellChecker.decoder.getGraph().getAllNodes(a->a.getAllChildNodes().size()==1).size());

        Path lmPath = Paths.get(ClassLoader.getSystemResource("lm-unigram.slm").toURI());
        NgramLanguageModel lm = SmoothLm.builder(lmPath.toFile()).build();

        Path r = Paths.get(ClassLoader.getSystemResource("10000_frequent_turkish_word").toURI());

        List<String> words = Files.readAllLines(r, StandardCharsets.UTF_8);
        int c = 0;
        Stopwatch sw = Stopwatch.createStarted();
        for (String word : words) {
            List<String> suggestions = spellChecker.suggestForWord(word, lm);
            c += suggestions.size();
        }
        Log.info("Elapsed = %d count = %d ", sw.elapsed(TimeUnit.MILLISECONDS), c);

    }