int getDictionaryId(String word) throws LongWordException {
        requireNonNull(word);
        if (word.length() > MAX_WORD_LENGTH) {
            throw new LongWordException("Too long value in the metric descriptor found, maximum is "
                    + MAX_WORD_LENGTH + ": " + word);
        }

        int nextWordId = orderedDictionary.size();
        return orderedDictionary
                .computeIfAbsent(word, key -> new Word(word, nextWordId))
                .id;
    }
@Test
    public void testGrowing() {
        for (int i = 0; i < 256; i++) {
            String word = Integer.toString(i);
            int dictionaryId = dictionary.getDictionaryId(word);
            assertEquals(i, dictionaryId);
        }
    }