void () { Element root = new Element("root"); root.addContent(new Text("$MACro1$ some text $macro2$ other text $MACRo3$")); root.addContent(new Text("$macro4$ some text")); root.addContent(new Text("some text$macro5$")); root.addContent(new Text("file:$mac_ro6$")); root.addContent(new Text("jar://$macr.o7$ ")); root.addContent(new Text("$mac-ro8$ ")); root.addContent(new Text("$$$ ")); root.addContent(new Text("$c:\\a\\b\\c$ ")); root.addContent(new Text("$Revision 1.23$")); root.addContent(new Text("file://$root$/some/path/just$file$name.txt")); final Set<String> macros = PathMacrosCollector.getMacroNames(root, null, new PathMacrosImpl(false)); UsefulTestCase.assertSameElements(macros, "MACro1", "macro4", "mac_ro6", "macr.o7", "mac-ro8", "root"); }