private NodeBuilder<V> insertChild(@Nullable NodeBuilder<V> node,
                                       String path, V value, boolean highPrecedence) {
        final PathReader pathReader = new PathReader(path);
        StringBuilder exactPath = null;

        while (pathReader.hasNext()) {
            final char c = pathReader.read();
            // Find the prefix until the first wildcard ('\0' or '*')
            // '\0' in this context signifies that the current path segment is a parameter.
            // See ParameterizedPathMapping for details on how '\0' is determined.
            if (c != '*' && c != '\0') {
                if (exactPath == null) {
                    exactPath = new StringBuilder();
                }
                exactPath.append(c);
                continue;
            }

            if (c == '*' && pathReader.hasNext()) {
                throw new IllegalStateException("Catch-all should be the last in the path: " + path);
            }

            if (exactPath != null) {
                node = asChild(new NodeBuilder<>(NodeType.EXACT, node, exactPath.toString()));
                exactPath = null;
            }

            if (c == '*') {
                node = asChild(new NodeBuilder<>(NodeType.CATCH_ALL, node, "*"));
            } else {
                node = asChild(new NodeBuilder<>(NodeType.PARAMETER, node, "\0"));
            }
        }

        // Make a new child node with the remaining characters of the path.
        if (exactPath != null) {
            node = asChild(new NodeBuilder<>(NodeType.EXACT, node, exactPath.toString()));
        }
        // Attach the value to the last node.
        assert node != null;
        node.addValue(value, highPrecedence, comparator);
        return node;
    }
Makes a node and then inserts it to the given node as a child.
core/src/main/java/com/linecorp/armeria/server/RoutingTrieBuilder.java