Implement a URL routing matcher that supports adding route patterns and matching request paths. Use a trie as the core data structure. Support static segments (e.g., /a/b/c) and a single-segment wildcard as in /a/*/c. Design APIs addRoute(pattern, handler), removeRoute(pattern), and match(path) -> matchedHandler (and the matched pattern). Define precedence rules when multiple patterns could match (e.g., prefer more specific over wildcard). Analyze time and space complexity and provide unit tests covering edge cases such as leading/trailing slashes, duplicate routes, and overlapping wildcard patterns.