src/main/java/com/github/fge/grappa/matchers/trie/TrieNodeBuilder.java
private void doAddWord(final CharBuffer buffer)
    {
        if (!buffer.hasRemaining()) {
            fullWord = true;
            return;
        }

        final char c = buffer.get();
        TrieNodeBuilder builder = subnodes.get(c);
        if (builder == null) {
            builder = new TrieNodeBuilder();
            subnodes.put(c, builder);
        }
        builder.doAddWord(buffer);
    }
private void doAddWord(final CharBuffer buffer)
    {
        if (!buffer.hasRemaining()) {
            fullWord = true;
            return;
        }

        final char c = buffer.get();
        TrieNodeBuilder builder = subnodes.get(c);
        if (builder == null) {
            builder = new TrieNodeBuilder();
            subnodes.put(c, builder);
        }
        builder.doAddWord(buffer);
    }
Add a word

<p>Here also, a {@link CharBuffer} is used, which changes position as we
progress into building the tree, character by character, node by node.
</p>

<p>If the buffer is "empty" when entering this method, it means a match
must be recorded (see {@link #fullWord}).</p>

@param buffer the buffer (never null)