@Override
    public Value get(String key) throws KeyNotFoundException {
        char[] array = key.toCharArray();
        Node node = this.root;

        for (char ch : array) {
            int childIndex = this.keyMap.get(ch);
            if (node.children[childIndex] == null) throw new KeyNotFoundException();
            else node = node.children[childIndex];
        }
        return node.value == null ? null : node.value;
    }