static double evaluateAugmentedNormalizedTermFrequency(int calculatedLevenshteinDistance, List<String> texts) {
        Map<String, Long> wordFrequencies =
                texts.stream().collect(Collectors.groupingBy(Function.identity(), counting()));
        int maxFrequency = wordFrequencies.values().stream()
                .max(Comparator.comparingLong(f -> f))
                .map(Long::intValue)
                .orElseThrow(() -> new KiePMMLException("Failed to find most frequent word!"));
        int binaryEvaluation = evaluateBinary(calculatedLevenshteinDistance);
        return 0.5 * (binaryEvaluation + (calculatedLevenshteinDistance / (double) maxFrequency)); // cast for
        // java:S2184
    }
@Test
    void evaluateAugmentedNormalizedTermFrequency() {
        Map<Integer, String> source = new HashMap<>();
        int maxFrequency = 23;
        source.put(maxFrequency, "aword");
        source.put(19, "anotherword");
        source.put(5, "adifferentword");
        source.put(3, "lastword");
        List<String> texts = new ArrayList<>();
        source.forEach((integer, s) -> IntStream.range(0, integer).forEach(i -> texts.add(s)));
        Collections.shuffle(texts);
        int calculatedLevenshteinDistance = 4;
        int binaryEvaluation = 1;
        double expected = 0.5 * (binaryEvaluation + (calculatedLevenshteinDistance / (double) maxFrequency)); // cast
        // for java:S2184
        assertThat(KiePMMLTextIndex.evaluateAugmentedNormalizedTermFrequency(calculatedLevenshteinDistance, texts)).isCloseTo(expected, Offset.offset(0.0));
    }