class ByteTrieNode<T>
    {
        private final Map<Byte, ByteTrieNode<T>> children = new HashMap<>();
        private T value = null;

        public void setValue(T value)
        {
            if (this.value != null)
            {
                throw new IllegalStateException("Value already set for this trie node");
            }
            this.value = value;
        }

        public T getValue()
        {
            return value;
        }
    }

    private final ByteTrieNode<T> root = new ByteTrieNode<>();
    private int maxDepth;

    /**
     * Return the most specific value stored for this byte sequence. If not found, returns
     * <code>null</code> or a default values as specified by calling
     * {@link ByteTrie#setDefaultValue}.
     * @param bytes
     * @return 
     */
    public T find(byte[] bytes)
    {
        ByteTrieNode<T> node = root;
        T val = node.getValue();
        for (byte b : bytes)
        {
            ByteTrieNode<T> child = node.children.get(b);
            if (child == null)
            {
                break;
            }
            node = child;
            if (node.getValue() != null)
            {
                val = node.getValue();
            }
        }
        return val;
    }

    /**
     * Store the given value at the specified path.
     * @param value
     * @param parts
     */
    public void addPath(T value, byte[]... parts)
    {<FILL_FUNCTION_BODY>

        int depth = 0;
        ByteTrieNode<T> node = root;
        for (byte[] part : parts)
        {
            for (byte b : part)
            {
                ByteTrieNode<T> child = node.children.get(b);
                if (child == null)
                {
                    child = new ByteTrieNode<>();
                    node.children.put(b, child);
                }
                node = child;
                depth++;
            }
        }
        node.setValue(value);
        maxDepth = Math.max(maxDepth, depth);
    
<no_super_class>